Noux
📦 A component container for React.JS
Install
npm i noux --save
About
Noux is a stupidly written component container rather than a state container. Because it stores the whole "this" (stupid idea, right?). Noux uses Pub/Sub pattern (PubSubJS). It is not a replacement for Redux like advanced libraries. Please be aware that this is not a production ready library.
demo.
Check the liveUsage
Declaring Noux
Import and declare Noux in your main component.
; { super; thisnoux = log: false // Optional [default: true] ; }
Initialization in a sub component
Initialize Noux in every new component.
{ super; thisnoux = propsnoux; thisnoux; }
Passing Noux as props
Pass Noux into new components as props.
<SubComponent noux=thisnoux/>
Methods
init()
To initialize Noux you have to call "noux.init" function. You can use this in any component.
thisnoux;
state()
Get the value of a specific state from the component.
Single state:
thisnoux
Multiple states:
thisnoux
setState()
Set the value of a specific state from the component.
thisnoux;
all()
Get the all connected components and states as object.
thisnouxall
revoke()
Remove the connected component from Noux.
thisnoux
Contributing
- Fork the project.
- Make your feature addition or bug fix.
- Send me a pull request.