0.2.4 • Published 10 years ago

mog-script v0.2.4

Weekly downloads
39
License
MIT
Repository
github
Last release
10 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

10 years ago

0.2.3

10 years ago

0.2.2

10 years ago

0.2.1

10 years ago

0.2.0

10 years ago

0.1.0

10 years ago

0.0.4

10 years ago

0.0.3

10 years ago

0.0.2

10 years ago

0.0.1

10 years ago