Skip to content

model.call()

Compare
Choose a tag to compare
@curran curran released this 17 Apr 11:01
· 106 commits to master since this release

As a convenient way to invoke mixins, the function model.call(fn) has been added (see #17 ). Similarly to call() in d3-selection, the given function will be invoked, passing the model as an argument. This makes it convenient to invoke mixins and use method chaining, like this:

my
  .call(ReactiveSVG)
  .call(ReactiveMargin);

As an example of this, see Margin Convention II with ReactiveModel.