angularjs-spawn-x
spawn-x.
AngularJS connector forinstall
With npm:
npm install angularjs-spawn-x --save
With yarn:
yarn add angularjs-spawn-x
With bower:
bower install angularjs-spawn-x --save
Usage
index.html
App
Add the ngSpawnModule in dependencies
app/index.js
;;; ; ;;; angular name; angular;
Configure store with ngSpawnProvider wich has standarts functions createStore and addInterceptor
app/store/index.js
configureStore$inject = 'ngSpawnProvider'; { const initialState = users: some: text: 'Hello World' parent: child: 'I am child' ; ngSpawnProvider; { return { ; console; } }}
Inject ngSpawn into your app, and use select, detect, reject and update methods
app/actions/user.js
; name; factory$inject = 'ngSpawn'; { const addUser = { ngSpawn; }; return addUser }
For subscribe or unsubscribe on data use connect and disconnect methods like below
app/containers/app.component.js
; name; { //selection from store const selection = users: 'users' text: 'some.text' data: 'parent.child' stateparentchild ; this { //connect to store ngSpawnthis; } this { //disconnect from store ngSpawn; } this { userActions; }}
app/components/presenter.component.js
; name; { this { console; console; this name: evtargetnamevalue age: evtargetagevalue ; evtargetnamevalue = ''; evtargetagevalue = ''; }}
LICENSE
MIT © Alex Plex