getting-started
Last updated
Was this helpful?
Last updated
Was this helpful?
Install @noflux/react
package by using :
Here is an Noflux app example. You can also debug it online: .
And modify the .babelrc
file to enable the plugin:
Code examples in the rest documents will be written using decorators syntax.
Noflux only exports two interfaces, state
and connect
。
state
maintains a global unique state and provides methods such as get
and set
to read/write state.
connect
will track changes in state
and re-render components intelligently.
The connect
in Noflux is a "decorator" in ES Next but also can run in the ES5 environment:
If you use a JavaScript compiler like , you can use @connect
decorator with a sample configuration. Run this command to install decorators plugin:
Noflux uses single source of truth and provide an immutable state
, that is similar to .
A component will be re-rendered via , meaning its render
method will be called if the value from state.get
was changed.
I believe you have had a preliminary impression of Noflux. Let's enter the next chapter: .