These are chat archives for ractivejs/ractive

15th
Jul 2018
Cerem Cem ASLAN
@ceremcem
Jul 15 2018 15:56
do you think the @shared variable is a good way to make components communicate with eachother?
Cerem Cem ASLAN
@ceremcem
Jul 15 2018 16:09
(by the way, @kouts , did you find an appropriate solution for your router seeking? if not, here is the more convenient form of my router which now supports UNAUTHORIZED and NOTFOUND scenes)
kouts
@kouts
Jul 15 2018 16:19
hi @ceremcem , no I haven't I will take a look when I have some time, thanks!
Cerem Cem ASLAN
@ceremcem
Jul 15 2018 16:28
you welcome. I know I should make it (them) also available as a standalone component(s)
Chris Reeves
@evs-chris
Jul 15 2018 17:14
@shared certainly isn't a bad way to have components communicate. I tend to have a single root instance and use it for shared data and as an event bus. Also has helped for auth, session-based fetches, and the like.
Cerem Cem ASLAN
@ceremcem
Jul 15 2018 22:05
I'm already using @shared in that way, as the event bus for session and router; glad to hear that
my actual purpose with this question was that if it would be a proper way to publish a standalone component which functions with both its attributes and the @shared variable, or not. so I'm taking this as a "yes", we may publish a component which is tightly coupled with @shared variable if it is necessary
Chris Reeves
@evs-chris
Jul 15 2018 23:49
absolutely, as long as you namespace it in shared 😁