observable - How can I send event for all mounted tags? -


riot.js 2.2

by guides on official site of riot.js have call like

tag.trigger('event_name') 

where tag instance of listener.

but must trigger event tags? has riot.js implementation issue or have resolve manually(by keeping listeners instances)?

riot has no implementation of keeping references event listeners. so, if want execute trigger on them directly, you'll have implement yourself.

however, recommend use solution notifying multiple event listeners.

if want let know multiple tags event has occured, can use shared observable , handle events on observable. see this question. way, don't need keep refereneces event listeners, instead, event listeners need keep reference single observable ('event aggregator').

you can try riotcontrol shared observable.


Comments

Popular posts from this blog

java - UnknownEntityTypeException: Unable to locate persister (Hibernate 5.0) -

python - ValueError: empty vocabulary; perhaps the documents only contain stop words -

ubuntu - collect2: fatal error: ld terminated with signal 9 [Killed] -