qmmr / atom-redux-snippets

Atom Snippets for Redux.

Home Page:https://atom.io/packages/redux-snippets

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Atom Redux Snippets

Atom snippets for Redux. This snippets uses Babel(ES2015, ES2016), CoffeeScript, LiveScript syntax.

Support Language

  • Babel (ES2015, ES2016)
  • CoffeeScript
  • LiveScript

Usage

  • import redux (rdx-ipt)
import { ${1:applyMiddleware, createStore, combineReducers, compose, bindActionCreators} } from 'redux';
  • import react-redux (rdx-iptc)
import { ${1:Provider, connect} } from 'react-redux';
  • action (rdx-act)
export function ${1:addTodo}($2) {
  $4

  return {
    $3
  };
}
  • async-action (rdx-acta)
export function ${1:addTodo}($2) {
  return (dispatch, getState) => {
    $4

    dispatch({
      $3
    });
  };
}
  • action-type (rdx-tp)
export const $1 = '$1';$2
  • actions-map (rdx-map)
const actionsMap = {
  [$1]: (state, action) => {
    $2
  }
};
  • map-action (rdx-mapact)
[$1]: (state, action) => {
  $2
}
  • reducer (rdxer)
export default function ${1:todos}(state = initialState, action) {
  $2

  return state;
}
  • middleware (rdx-mdw)
export default function $1({ dispatch, getState }) {
  return next => action => {

    ${2: next(action);}
  };
}

about LiveScript, CoffeeScript snippets generated code, see live.cson and coffee.cson.

LICENSE

MIT

About

Atom Snippets for Redux.

https://atom.io/packages/redux-snippets

License:MIT License


Languages

Language:CoffeeScript 100.0%