npm.io
1.0.1 • Published 7 years ago

s2s-helper-get-reducer-case

Licence
MIT
Version
1.0.1
Deps
2
Size
3 kB
Vulns
0
Weekly
0
Stars
265

s2s-helper-get-reducer-case

Helper function to get reducer case

API

import helper from 's2s-helper-get-reducer-case'

const fixture = `
export default function(state, action) {
  switch(action.type) {
    case Actions.INCREMENT:
      return { count: state + 1}
    case Actions.DECREMENT:
      return { count: state - 1}
    default:
      return state
  }
}
`

helper(fixture)
// => ['INCREMENT', 'DECREMENT']