To conform better with web components (such as in the Polymer framework), the API for custom elements in Cycle has been changed from:
h('my-element', {attributes: {age: 30}});
to
h('my-element', {age: 30});
Where the definition of my-element
used to be:
var MyElementComponent = Cycle.createView(function (Attributes) {
// do something with Attributes.get('age')
};
it should now be (this is not part of the breaking change, just a rename of the argument in order to express better the new change in semantics):
var MyElementComponent = Cycle.createView(function (Properties) {
// do something with Properties.get('age')
};
The reason for this breaking change is that: you might want to specify properties that are not under {attributes: ...}
but still use them internally in the component implementation. For instance, in v0.10 you had to do {attributes: {style: {color: color}}
where style would be translated to Attributes.get('style$')
and this doesn't make sense since normal elements in virtual-dom such as div should use the API {attributes: {...}, style: {color: color}}
with style outside of attributes.