0
0
mirror of https://github.com/naturalcrit/homebrewery.git synced 2026-01-14 08:32:44 +00:00

Updating libs and adding basic flux

This commit is contained in:
Scott Tolksdorf
2016-12-26 13:47:49 -05:00
parent cc8e874ad1
commit 7581d155a6
3 changed files with 50 additions and 4 deletions

View 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;