0.2.4 ā€¢ Published 8 years ago

mog-script v0.2.4

Weekly downloads
39
License
MIT
Repository
github
Last release
8 years ago

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:

šŸ’Ž šŸ§.šŸ’Ž

šŸš„

0.2.4

8 years ago

0.2.3

8 years ago

0.2.2

8 years ago

0.2.1

8 years ago

0.2.0

8 years ago

0.1.0

8 years ago

0.0.4

8 years ago

0.0.3

8 years ago

0.0.2

8 years ago

0.0.1

8 years ago