Echo JS 0.11.0

<~>
ayatkevich 2941 days ago. link parent 1 point
You are right. That's why I added ability to get the type without instantiation of the action.

const setVisibilityFilter = action('SET_VISIBILITY_FILTER', 'filter');

function todoApp(state = initialState, action) {
  switch (action.type) {
    case setVisibilityFilter.type:
      return Object.assign({}, state, {
        visibilityFilter: action.filter
      });
    default:
      return state;
  }
}

Replies