ractivejs / ractivejs.github.io

https://ractive.js.org
8 stars 33 forks source link

Example for demonstrating communication between components #89

Closed ceremcem closed 6 years ago

ceremcem commented 7 years ago

I prepared a reproduction code for a possible bug (an undocumented breaking change) in between 0.9.2 and 0.9.3 and guess what: I found nothing :D

Maybe that code could be used in the examples section to show how to communicate between components.

fskreuz commented 7 years ago

That suggestion can probably be included in https://github.com/ractivejs/ractivejs.github.io/pull/73 . 😄

fskreuz commented 7 years ago

Also, as much as I like writing docs, I'm not knowledgeable about the breaking change between 0.9.2 and 0.9.3. 😬

Feel free to post a PR to update the migration section tho. PRs are always welcome.

evs-chris commented 7 years ago

The breaking change was probably a bug fix from ractivejs/ractive#3033, namely that firing with an object first arg will extend the context rather than passing an object first arg. If you need to fire an object first arg, you have to throw an empty object in there first e.g. this.fire('someEvent', {}, { first: true }). Polymorhpic functions in js are unpleasant :(

fskreuz commented 7 years ago

Polymorhpic functions in js are unpleasant

image

fskreuz commented 6 years ago

Closing in favor of https://github.com/ractivejs/ractivejs.github.io/issues/74