These are chat archives for ractivejs/ractive

23rd
Nov 2018
kouts
@kouts
Nov 23 2018 13:57
Question: I want to observe 3 separate keys of an object. Which approach is more performant?
  • One observer for the object that inside makes the decision based on keypath
  • 3 observers one for each object key that I want observed
Arnaud Dagnelies
@dagnelies
Nov 23 2018 15:06
@kouts Try it out ;) ...my guess is that the difference would be neglectable and that clarity of code should be favored :P
Chris Reeves
@evs-chris
Nov 23 2018 15:28
You could also do one observer for all three keys e.g. r.observe('key.one key.two key.three', ...)
kouts
@kouts
Nov 23 2018 15:30
Nice, so theoretically what would be the best choice?
Chris Reeves
@evs-chris
Nov 23 2018 15:51
if there aren't many keys on the object that change, it wouldn't really matter, but if there are, that should be more performant than a wildcard
kouts
@kouts
Nov 23 2018 15:52
ok thanks!
These are just settings for a site's theme that trigger some css class changes outside of Ractive's influence area
kouts
@kouts
Nov 23 2018 16:38
is there any way to store these settings in local storage and make them reactive?
Ideally use the ractive get set mechanism to manipulate them
Chris Reeves
@evs-chris
Nov 23 2018 16:40
You may be able to write an adapter, but due to its stringy nature, I usually just manually persist stuff to local and session storage
I don't think I've ever tried to be reactive with it
just read on load and store when changes happen
kouts
@kouts
Nov 23 2018 17:02
:thumbsup:
Cerem Cem ASLAN
@ceremcem
Nov 23 2018 22:12
there is currently no such thing like git that runs in browser, right?
Chris Reeves
@evs-chris
Nov 23 2018 22:19
there's a js git implementation somewhere
cloud 9 has one, I think
Cerem Cem ASLAN
@ceremcem
Nov 23 2018 22:47
really? o_O
I searched for "git in browser", "git npm" "git nodejs", nothing appeared
now I found js-git
looks like there're a few out there now
Cerem Cem ASLAN
@ceremcem
Nov 23 2018 22:52
wow, they are aiming to be 100% compatible with git, so are capable of doing pull/push to github (etc)