These are chat archives for ractivejs/ractive

25th
Jan 2019
Arnaud Dagnelies
@dagnelies
Jan 25 14:55
hi, is there an example somewhere how to use "@shared"?
Can I set it in a component and read it from another?
kouts
@kouts
Jan 25 14:56
yes you can
Ractive.sharedSet({'attr1': 'Hello', 'attr2': 'World'});
Arnaud Dagnelies
@dagnelies
Jan 25 14:57
aha! Great :tada:
Thanks, that was my missing part! ;)
kouts
@kouts
Jan 25 14:58
you can of course use the non-object variant Ractive.sharedSet('attr1', 'Hello world!');
you can also do:
ractive.set('@shared.attr1': 'Hello world!');
and then
ractive.get('@shared.attr1');
Arnaud Dagnelies
@dagnelies
Jan 25 15:01
wonderful, thanks mate
kouts
@kouts
Jan 25 15:02
:thumbsup: