{"id":21574045,"url":"https://github.com/ln613/state","last_synced_at":"2025-06-11T07:09:55.007Z","repository":{"id":41810359,"uuid":"147837592","full_name":"ln613/state","owner":"ln613","description":null,"archived":false,"fork":false,"pushed_at":"2023-01-23T21:51:26.000Z","size":1009,"stargazers_count":0,"open_issues_count":15,"forks_count":0,"subscribers_count":1,"default_branch":"master","last_synced_at":"2025-05-21T07:56:19.610Z","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":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/ln613.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2018-09-07T14:53:47.000Z","updated_at":"2020-04-20T07:23:12.000Z","dependencies_parsed_at":"2023-02-02T11:45:25.295Z","dependency_job_id":null,"html_url":"https://github.com/ln613/state","commit_stats":null,"previous_names":[],"tags_count":3,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ln613%2Fstate","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ln613%2Fstate/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ln613%2Fstate/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ln613%2Fstate/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/ln613","download_url":"https://codeload.github.com/ln613/state/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ln613%2Fstate/sbom","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":259219713,"owners_count":22823577,"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-24T12:08:31.929Z","updated_at":"2025-06-11T07:09:54.973Z","avatar_url":"https://github.com/ln613.png","language":"JavaScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"# no-redux\n\n[![Build Status](https://travis-ci.org/ln613/no-redux.svg?branch=master)](https://travis-ci.org/ln613/no-redux)\n\nA react/redux library which automates all redux flows including http calls, and store immutability is guaranteed. Redux becomes invisible to you, hence the name no-redux.\n\n|   | redux | no-redux |\n|---|---|---|\n| define action type | manual | manual |\n| generate action creator | manual | auto |\n| call action creator in components | ‎manual | manual |\n| handle action in middleware (thunk/saga...) | ‎manual | auto |\n| send http request | ‎manual | auto |\n| receive http response | ‎manual | auto |\n| handle action in reducer | manual | auto |\n| ensure store immutability | ‎manual | auto |\n\n[slides and demo](https://ln613.github.io/no-redux)\n\n[todo example](https://ln613.github.io/no-redux-todo-example)\n\n[documetation](https://ln613.gitbooks.io/no-redux/)\n## Install\n\n`npm i -S no-redux`\n\n## Usage\n\n**Step 1**\n\nDefine an action data object, and call \"generateActions\" to generate action creators.\n\n```js\nimport { generateActions } from 'no-redux';\n\nexport const actionData = {\n  artists: {\n    url: 'http://localhost/api/artists'\n  }\n}\n\nexport default generateActions(actionData);\n```\n\n**Step 2**\n\nCreate a redux store by calling the \"createStore\" function from \"no-redux\" with the action data object you defined in step 1. The \"createStore\" function will generate reducers and middlewares that handle http calls and register them with the store.\n\n```js\nimport React from 'react';\nimport { render } from 'react-dom';\nimport { Provider, createStore } from 'no-redux';\nimport { actionData } from './actions';\nimport App from './App';\n\nrender(\n  \u003cProvider store={createStore(actionData)}\u003e\n    \u003cApp /\u003e  \n  \u003c/Provider\u003e,\n  document.getElementById('root')\n);\n```\n\n**Step 3**\n\nIn your component, connect to the store with the action creators you created in step 1. When you call the action creator functions, no-redux will make http requests, get the http response and put the results on the redux store.\n\n```js\nimport React from 'react';\nimport { connect } from 'no-redux';\nimport actions from './actions';\n\nclass App extends React.Component {\n  componentWillMount() {\n    this.props.getArtists();\n  }\n\n  render() {\n    return (\n      \u003cdiv\u003e\n        {(this.props.artists || []).map(a =\u003e \n          \u003cdiv\u003e{a.name}\u003c/div\u003e\n        )}\n      \u003c/div\u003e\n    );\n  }\n}\n\nexport default connect(s =\u003e ({ artists: s.artists }), actions)(App);\n```\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fln613%2Fstate","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fln613%2Fstate","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fln613%2Fstate/lists"}