mog-script
v0.2.4
Published
## Installation πΎ
Downloads
3
Readme
M.O.G. Script
Installation πΎ
npm install -g mog-script
Usage π΄
Say you have a M.O.G. file named π§.π
that contains:
π { createStore } = require('redux')
π reducer = βοΈ (state, action) {
π¦ (action.type) {
πΌ 'INCREMENT':
π state + action.payload
πΌ 'DECREMENT':
π state - action.payload
}
}
π initialState = 0
π store = createStore(reducer, initialState)
store.subscribe(βοΈ () { console.log(`New value is ${store.getState()}`) }
process.stdin.on('data', βοΈ (chunk) {
β (chunk[0] === '-') {
store.dispatch({ type: 'DECREMENT', payload: chunk.slice(1) })
} βοΈ {
store.dispatch({ type: 'INCREMENT', payload: chunk })
}
})
You can run it with:
π π§.π
π