atom-redux-duck-snippets

Atom Snippets for Redux Duck

Sergio Daniel Xalambrí

260

1

Bug Reports

1.0.0

MIT

GitHub

Atom Redux Duck Snippets

Atom Snippets for Redux Duck. This snippets uses Babel(ES2015, ES2016) syntax.

Support Language

Usage

import { createDuck } from 'redux-duck';
const duck = createDuck('$1', '$2')$3
const $1 = duck.defineType('$1');$2
/**
 * Create $1 action object
 * @params  {Object} payload Action data
 * @returns {Object}         Action object
 */
export const $2 = duck.createAction($1);$3
/**
 * $1
 * @param  {Object} state  Actual state object
 * @param  {Object} action Changes to apply
 * @return {Object}        New state object
 */
export default duck.createReducer({
  ${3:duck-case}
}, $2);
[$1]: (state, { payload = {} }) => {
  ${2:return state;}
},$3

LICENSE

MIT