mirror of
https://github.com/naturalcrit/homebrewery.git
synced 2026-01-13 08:42:42 +00:00
Updating libs and adding basic flux
This commit is contained in:
@@ -22,15 +22,15 @@
|
|||||||
"cookie-parser": "^1.4.3",
|
"cookie-parser": "^1.4.3",
|
||||||
"express": "^4.13.3",
|
"express": "^4.13.3",
|
||||||
"jwt-simple": "^0.5.1",
|
"jwt-simple": "^0.5.1",
|
||||||
"lodash": "^4.11.2",
|
"lodash": "^4.17.3",
|
||||||
"marked": "^0.3.5",
|
"marked": "^0.3.5",
|
||||||
"moment": "^2.11.0",
|
"moment": "^2.11.0",
|
||||||
"mongoose": "^4.3.3",
|
"mongoose": "^4.3.3",
|
||||||
"nconf": "^0.8.4",
|
"nconf": "^0.8.4",
|
||||||
"pico-flux": "^1.1.0",
|
"pico-flux": "^2.0.0",
|
||||||
"pico-router": "^1.1.0",
|
"pico-router": "^1.1.0",
|
||||||
"react": "^15.0.2",
|
"react": "^15.4.1",
|
||||||
"react-dom": "^15.0.2",
|
"react-dom": "^15.4.1",
|
||||||
"shortid": "^2.2.4",
|
"shortid": "^2.2.4",
|
||||||
"striptags": "^2.1.1",
|
"striptags": "^2.1.1",
|
||||||
"superagent": "^1.6.1",
|
"superagent": "^1.6.1",
|
||||||
|
|||||||
15
shared/naturalcrit/brew.actions.js
Normal file
15
shared/naturalcrit/brew.actions.js
Normal file
@@ -0,0 +1,15 @@
|
|||||||
|
const dispatch = require('pico-flux').dispatch;
|
||||||
|
|
||||||
|
const Actions = {
|
||||||
|
addInc : (val = 1) => {
|
||||||
|
dispatch('ADD_INC', val);
|
||||||
|
},
|
||||||
|
delayInc : (val = 1) => {
|
||||||
|
dispatch('DELAY_INC', val)
|
||||||
|
},
|
||||||
|
setInc : (newInc) => {
|
||||||
|
dispatch('SET_INC', newInc);
|
||||||
|
},
|
||||||
|
};
|
||||||
|
|
||||||
|
module.exports = Actions;
|
||||||
31
shared/naturalcrit/brew.store.js
Normal file
31
shared/naturalcrit/brew.store.js
Normal file
@@ -0,0 +1,31 @@
|
|||||||
|
const _ = require('lodash');
|
||||||
|
const flux = require('pico-flux');
|
||||||
|
|
||||||
|
let State = {
|
||||||
|
count : 0
|
||||||
|
};
|
||||||
|
|
||||||
|
const Store = flux.createStore({
|
||||||
|
INC : (val) => {
|
||||||
|
State.count += val;
|
||||||
|
},
|
||||||
|
|
||||||
|
SET_INC : (val) => {
|
||||||
|
State.count = val;
|
||||||
|
return false;
|
||||||
|
},
|
||||||
|
|
||||||
|
DELAY_INC : (val) => {
|
||||||
|
setTimeout(()=>{
|
||||||
|
State.count += val;
|
||||||
|
Store.emitChange();
|
||||||
|
}, 2000);
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
});
|
||||||
|
|
||||||
|
Store.getCount = ()=>{
|
||||||
|
return State.count;
|
||||||
|
};
|
||||||
|
|
||||||
|
module.exports = Store;
|
||||||
Reference in New Issue
Block a user