Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add alternative signatures for Model#start and Model#on that don't use var-args #263

Merged
merged 5 commits into from
Jul 11, 2019

Commits on Jul 9, 2019

  1. Add alternative signatures for Model#start and Model#on that don't us…

    …e var-args
    
    The var-args in the middle of parameter lists for Model#start and Model#on make it difficult to write TypeScript type definitions for them.
    
    These backwards-compatible changes add alternative signatures that don't use var-args.
    
    1) Model#start now supports a new array format for input paths:
    
      model.start(outPath, inPath1, inPath2, ..., fn);  // Old
      model.start(outPath, [inPath1, inPath2, ...], fn); // New
    
    2) Model#on now checks if the path pattern is a pre-split array, and if so, it calls the listener with a ____Event instance and the wildcard-captured segments as an array:
    
      model.on('change', 'foo.**', (captures..., value, previous, passed) => {});  // Old
      model.on('change', ['foo', '**'], (changeEvent, captures) => {});  // New
    
    A ChangeEvent would look like {value, previous, passed}.
    ericyhwang committed Jul 9, 2019
    Configuration menu
    Copy the full SHA
    c922964 View commit details
    Browse the repository at this point in the history

Commits on Jul 10, 2019

  1. Configuration menu
    Copy the full SHA
    552dcdf View commit details
    Browse the repository at this point in the history

Commits on Jul 11, 2019

  1. Configuration menu
    Copy the full SHA
    8cf47b5 View commit details
    Browse the repository at this point in the history
  2. Configuration menu
    Copy the full SHA
    d1dcca4 View commit details
    Browse the repository at this point in the history
  3. Style tweaks

    ericyhwang committed Jul 11, 2019
    Configuration menu
    Copy the full SHA
    055b8f3 View commit details
    Browse the repository at this point in the history