Tobias Uhlig
Aug 22, 2021

--

Hi Nicklas,

regarding state management in neo. For components, you can simply use:

// setter, triggers the vdom engine
myButton.text = ‘Hello World’;
// bulk update, triggers the vdom engine once
myButton.set({
iconCls: 'fa fa-user',
text : 'foo'
});

You can add references to components and then access them inside view controllers for updates.

It does get more powerful when adding optional view models into the mix:

We can bind component configs (similar to class fields) to model data props anywhere inside the parent chain and changing a data prop will automatically adjust all bound views. Two way bindings are in place as well.

I don’t think I can share friends links here, so you could open the neo blog and scroll down to “Enhance your frontend state management with view models”.

https://github.com/neomjs/neo

Feel free to hop into the Slack Channel for questions!

Best regards,
Tobi

--

--

No responses yet