Skip to content

v0.9.6

Compare
Choose a tag to compare
@ericyhwang ericyhwang released this 12 Jul 18:57
· 346 commits to master since this release

#263 - This release adds alternative signatures for Model#start and Model#on that don't use var-args.

The changes are backwards-compatible, and there are no current plans to remove the legacy signatures. New code should use the new signatures where possible.

  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
  1. Model#on has a new {useEventObjects: boolean} option. If true, it calls the listener with an Event object and the wildcard-captured segments as an array:
// Old
model.on('change', 'foo.**', (captures..., value, previous, passed) => {
});
// New
model.on('change', 'foo.**', {useEventObjects: true}, (changeEvent, captures) => {
  const {type, value, previous, passed} = changeEvent;
});