A RetroSearch Logo

Home - News ( United States | United Kingdom | Italy | Germany ) - Football scores

Search Query:

Showing content from https://github.com/PlatziDev/redux-duck below:

PlatziDev/redux-duck: Helper function to create Redux modules using the ducks-modular-redux proposal

Helper function to create Redux modules using the ducks-modular-redux proposal.

import { createDuck } from 'redux-duck';

const myDuck = createDuck('duck-name', 'application-name');
const ACTION_TYPE = myDuck.defineType('ACTION_TYPE');
const actionType = myDuck.createAction(ACTION_TYPE);
const initialState = {
  list: Immutable.List(),
  data: Immutable.Map(),
};

const reducer = myDuck.createReducer({
  [ACTION_TYPE]: (state, action) => ({
    ...state,
    list: state.list.push(action.payload.id),
    data: state.map.set(action.payload.id+'', action.payload),
  }),
}, initialState);

RetroSearch is an open source project built by @garambo | Open a GitHub Issue

Search and Browse the WWW like it's 1997 | Search results from DuckDuckGo

HTML: 3.2 | Encoding: UTF-8 | Version: 0.7.4