github cyclejs/cyclejs v0.8.0
v0.8.0 - Big breaking change to Views and DataFlowNodes

latest releases: unified-tag, v7.0.0, v7.0.0-rc8...
pre-release9 years ago

Major breaking changes to the API

Updated virtual-dom to 1.0.0.

No more interfaces array when declaring DataFlowNodes.
Interfaces are completely removed as a requirement for DataFlowNodes. Instead, use a getter to access properties of input DataFlowNodes, as such model.get('name$'). When ES6 Proxy is available in browsers, we will use it to implement the getter and recover the original API of model.name$. For now we must rely on explicit getters.

Removed events array required output for Views.
Interaction events are dynamically detected whenever they are used by, e.g., Intents.

Removed circularInject(), enhanced usage of inject()
Cycle.circularInject() was removed, but now a.inject(b) will return b so you can make circular dependencies using Intent.inject(View).inject(Model).inject(Intent).

Replaced 'ev-click' with onclick for exported interaction events in Views.
We now favor the DOM's native way of working rather than virtual-dom jargon. Also the dom-delegator dependency was removed as consequence.

In summary, before in v0.7.0:

var View = Cycle.createView(['name$'], function (model) {
  return {
    vtree$: model.name$.map(function (name) {
      return h('h1', {'ev-click': 'nameClicks$'}, name);
    }),
    events: ['nameClicks$']
  };
});

Cycle.circularInject(Model, View, Intent);

Now in v0.8.0:

var View = Cycle.createView(function (model) { // no interface array
  return {
    // notice model.get('name$') instead of model.name$
    vtree$: model.get('name$').map(function (name) {
      return h('h1', {onclick: 'nameClicks$'}, name); // onclick
    })
    // no more events array
  };
});

Intent.inject(View).inject(Model).inject(Intent); // no more circularInject()

Don't miss a new cyclejs release

NewReleases is sending notifications on new releases.