These are chat archives for ractivejs/ractive

29th
Nov 2017
Cerem Cem ASLAN
@ceremcem
Nov 29 2017 09:57
@andreujuanc do you think these kind of frameworks (like cordova, nativescript, ionic, ...) have huge performance/ability differences between each other? I feel like I've lost for a long time on this setup
kouts
@kouts
Nov 29 2017 15:44
If I initialize ractive (main instance) without data object and set the data object afterwards (using ajax) then ractive does not update the view, is this expected?
Chris Reeves
@evs-chris
Nov 29 2017 15:45
by setting the data property on the instance? yes, that would be expected
if you need to set multiple root properties, I'd use a deep set in the ajax callback
kouts
@kouts
Nov 29 2017 15:47
hmmm
if I use
                        window.ractive.unrender();
                        window.ractive.set(data);
                        window.ractive.render();
it works!
Chris Reeves
@evs-chris
Nov 29 2017 15:48
are there components involved?
kouts
@kouts
Nov 29 2017 15:49
yes
and they got rendered as expected (using the last workaround)
Chris Reeves
@evs-chris
Nov 29 2017 15:50
non-isolated?
kouts
@kouts
Nov 29 2017 15:51
non-isolated yes
Chris Reeves
@evs-chris
Nov 29 2017 15:51
you could also drop the target/el from the init options and just render once after the data arrives
kouts
@kouts
Nov 29 2017 15:52
I will try that thanks
Chris Reeves
@evs-chris
Nov 29 2017 15:52
when an unresolved shows up in a component, it defaults to resolving in its own context, so your references end up pointing to component data
you could also stub out your data on the root so that refs resolve there instead of in the component