{"id":18651327,"url":"https://github.com/armed/dead-simple-redux-helper","last_synced_at":"2025-11-05T13:30:23.454Z","repository":{"id":66153635,"uuid":"52708205","full_name":"armed/dead-simple-redux-helper","owner":"armed","description":"Dead simple redux helper for actions and reducers","archived":false,"fork":false,"pushed_at":"2016-02-28T06:30:54.000Z","size":2,"stargazers_count":4,"open_issues_count":0,"forks_count":0,"subscribers_count":2,"default_branch":"master","last_synced_at":"2024-12-27T13:23:53.812Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"language":"JavaScript","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/armed.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":null,"code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2016-02-28T06:29:34.000Z","updated_at":"2020-01-10T07:43:01.000Z","dependencies_parsed_at":null,"dependency_job_id":"c0cc09d8-b53c-444d-bb51-a95e46f6e6fd","html_url":"https://github.com/armed/dead-simple-redux-helper","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/armed%2Fdead-simple-redux-helper","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/armed%2Fdead-simple-redux-helper/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/armed%2Fdead-simple-redux-helper/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/armed%2Fdead-simple-redux-helper/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/armed","download_url":"https://codeload.github.com/armed/dead-simple-redux-helper/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":239459532,"owners_count":19642227,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":[],"created_at":"2024-11-07T06:49:31.745Z","updated_at":"2025-11-05T13:30:23.276Z","avatar_url":"https://github.com/armed.png","language":"JavaScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Dead simple redux helpers\n\n## Installation\n\n```bash\n$ npm install --save dead-simple-redux-helper\n```\n## Usage\n\n```javascript\nimport { createAction, createReducer } from 'dead-simple-redux-helper';\n```\n\n### Creating standard Flux action creators\n\n```javascript\nconst MY_ACTION = 'myAction';\n\n\n// returns flux action creator:\nconst someAction = createAction(MY_ACTION);\n\n/* returns standard flux action:\n{\n  type: MY_ACTION,\n  payload: 'hello'\n}\n*/\nconst action = someAction('hello');\n```\n\n### Creating standard Flux action creators with argument transformer\n\n```javascript\nconst MY_COMPLEX_ACTION = 'myComplexAction';\n\n// pass property names, which will be used to create `payload` object\nconst complexAction = createAction(MY_COMPLEX_ACTION, ['name', 'lastName', 'age']);\n\n/* returns\n{\n  type: MY_COMPLEX_ACTION,\n  payload: {\n    name: 'John',\n    lastName: 'Smith',\n    age: 42\n  }\n}\n*/\nconst action = complexAction('John', 'Smith', 42);\n\n/* returns\n{\n  type: MY_COMPLEX_ACTION,\n  payload: {\n    name: 'John',\n    lastName: undefined,\n    age: undefined\n  }\n}\n*/\nconst action = complexAction('John');\n```\n\n### Creating reducers\n\n```javascript\nconst MY_ACTION = 'myAction';\nconst MY_COMPLEX_ACTION = 'myComplexAction';\n\nconst initialState = {\n  name: '',\n  lastName: '',\n  age: 0,\n}\n\n// returns state if action.type does not match\nconst myReducer = createReducer(initialState, {\n  // every handler has 2 params: `state = initialState`, and `action.payload`\n  [MY_ACTION](state, payload) {\n    // do something\n    return newState\n  },\n  // { name, lastName, age } = payload (see above)\n  [MY_COMPLEX_ACTION](state, payload) {\n    // do something\n    return newState\n  }\n})\n```\n\n### License\n\nMIT\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Farmed%2Fdead-simple-redux-helper","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Farmed%2Fdead-simple-redux-helper","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Farmed%2Fdead-simple-redux-helper/lists"}