0
0
mirror of https://github.com/naturalcrit/homebrewery.git synced 2026-01-13 04:22:40 +00:00
Files
homebrewery/shared/naturalcrit/brew.store.js
2017-01-22 12:36:45 -05:00

31 lines
432 B
JavaScript

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;