cycle.js How to select element from instance of component

216 Views Asked by At

With cycle.js I am trying to create a reusable component that can exist multiple times of the page, including event handlers.

When using DOMSource.select it seems to be matching on the entire app container. Is there a way I can .select from only my (this instance of the component's) sub elements?

2

There are 2 best solutions below

0
On BEST ANSWER

If you have a single component or just a few, isolate() mentioned by tm1rbrt works well and is simple to use.

If you have a large list of objects to render as components, especially if you have to update that list, try out cycle.js collections: https://github.com/cyclejs/collection

0
On

The answer was to use isolate(). It's somewhat similar to every Iterable item in react needing a key attribute.