markerikson / redux-ecosystem-links

A categorized list of Redux-related addons, libraries, and utilities
5.23k stars 372 forks source link

Reducer as map of functions #74

Closed NookieGrey closed 6 years ago

NookieGrey commented 6 years ago

I find createReducer function in documentation https://redux.js.org/recipes/reducing-boilerplate#reducers

export function createReducer(initialState, handlers) {
  return (state = initialState, action) => {
    if (handlers.hasOwnProperty(action.type)) {
      return handlers[action.type](state, action);
    }
    return state;
  };
}

Is it any package in npm where i can refer in my app or I need to add this function in all projects and add link to this documentation?

NookieGrey commented 6 years ago

found https://github.com/markerikson/redux-starter-kit

markerikson commented 6 years ago

There's also many other similar options - see https://github.com/markerikson/redux-ecosystem-links/blob/master/reducers.md#reducer-utilities .

NookieGrey commented 6 years ago

This list is very big, can it be sorted by starts?

markerikson commented 6 years ago

@NugzarGaguliya : not this list in its current form, no, because it's all just Markdown text files.

However, there's an app being built that will parse this list and present it in a sortable form, at https://github.com/wilbertliu/redux-ecosystem . It's not done yet, but I think it's getting close.