Closed mbykov closed 3 years ago
You can access out
(and thus out.global
) in the onCreate
, onInput
and onRender
lifecycles. https://markojs.com/docs/class-components/#lifecycle-event-methods
One thing to note is that out.global
is scoped to the current render, and is lost when rerendering in the browser. You can tell Marko to persist a subset of the out.global
properties during the initial hydration using an allow list (see serializedGlobals
here: https://markojs.com/docs/rendering/#global-data). If you want that data to be long lived in the browser though you'll need to copy it somewhere else during app hydration.
Thank you!
Description
In template.marko ${out.global} works perfect.
But how can I get global out in component.js?
I've tried
console.log(window.locals); console.log(window.out);
and so on, but alas...