{"id":15015888,"url":"https://github.com/ember-redux/ember-redux","last_synced_at":"2025-04-04T13:12:17.843Z","repository":{"id":52625126,"uuid":"54754271","full_name":"ember-redux/ember-redux","owner":"ember-redux","description":"Predictable state management for ember apps","archived":false,"fork":false,"pushed_at":"2022-12-14T13:43:43.000Z","size":1268,"stargazers_count":279,"open_issues_count":4,"forks_count":34,"subscribers_count":8,"default_branch":"master","last_synced_at":"2025-03-28T12:09:00.756Z","etag":null,"topics":["emberjs","redux"],"latest_commit_sha":null,"homepage":"https://ember-redux.com/","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/ember-redux.png","metadata":{"files":{"readme":"README.md","changelog":"CHANGELOG.md","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":"2016-03-26T00:04:28.000Z","updated_at":"2025-01-24T10:17:57.000Z","dependencies_parsed_at":"2023-01-28T23:31:00.238Z","dependency_job_id":null,"html_url":"https://github.com/ember-redux/ember-redux","commit_stats":null,"previous_names":[],"tags_count":38,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ember-redux%2Fember-redux","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ember-redux%2Fember-redux/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ember-redux%2Fember-redux/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ember-redux%2Fember-redux/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/ember-redux","download_url":"https://codeload.github.com/ember-redux/ember-redux/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":247182401,"owners_count":20897381,"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":["emberjs","redux"],"created_at":"2024-09-24T19:48:06.205Z","updated_at":"2025-04-04T13:12:17.817Z","avatar_url":"https://github.com/ember-redux.png","language":"JavaScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Ember Redux\n\n[![Travis][build-badge]][build] [![Code Climate][climate-badge]][climate] [![Score][score-badge]][score] [![Downloads][downloads-badge]][npm] [![npm package][npm-badge]][npm]\n\nPredictable state management for ember apps\n\n## Installation\n\nember redux requires ember v3.6+ and node \u003e= 8. If you need support for an older version of ember use the v5 release\n\n```\nember install ember-redux\n```\n\n## Documentation and Examples\n\nhttps://ember-redux.com\n\n## Demo\n\nCounter\nhttps://ember-twiddle.com/5bee7478e4216abe49f1c0a439bae352\n\nTodoMVC\nhttps://ember-twiddle.com/4bb9c326a7e54c739b1f5a5023ccc805\n\n## Usage\n\n### Container Component\n\n```js\nimport Component from '@ember/component';\nimport hbs from 'htmlbars-inline-precompile';\nimport { connect } from 'ember-redux';\nimport getUsersByAccountId from '../reducers';\nimport fetch from 'fetch';\n\nconst stateToComputed = (state, attrs) =\u003e ({\n  users: getUsersByAccountId(state, attrs.accountId)\n});\n\nconst dispatchToActions = (dispatch) =\u003e ({\n  remove: (id) =\u003e fetch(`/api/users/${id}`, {method: 'DELETE'}).then(fetched =\u003e fetched.json()).then(response =\u003e dispatch({type: 'REMOVE_USER', id: id}))\n});\n\nconst UserListComponent = Component.extend({\n  layout: hbs`\n    {{yield users (action \"remove\")}}\n  `\n});\n\nexport default connect(stateToComputed, dispatchToActions)(UserListComponent);\n```\n\n### Presentation Component\n\n```js\nimport Component from '@ember/component';\nimport hbs from 'htmlbars-inline-precompile';\n\nconst UserTableComponent = Component.extend({\n  layout: hbs`\n    {{#each users as |user|}}\n      \u003cdiv\u003e{{user.name}}\u003c/div\u003e\n      \u003cbutton onclick={{action remove user.id}}\u003eremove\u003c/button\u003e\n    {{/each}}\n  `\n});\n\nexport default UserTableComponent;\n```\n\n### Composition\n\n```js\n{{#user-list accountId=accountId as |users remove|}}\n  {{user-table users=users remove=remove}}\n{{/user-list}}\n```\n\n## Octane Support?\n\nAs of version 6 ember-redux now supports both ember component and glimmer component. One brief example of glimmer components and ember redux below.\n\n```js\nimport Component from '@glimmer/component';\nimport { action } from '@ember/object';\nimport { connect } from 'ember-redux';\nimport getUsersByAccountId from '../reducers';\nimport fetch from 'fetch';\n\nconst stateToComputed = (state, attrs) =\u003e ({\n  users: getUsersByAccountId(state, attrs.accountId)\n});\n\nconst dispatchToActions = (dispatch) =\u003e ({\n  remove: (id) =\u003e fetch(`/api/users/${id}`, {method: 'DELETE'}).then(fetched =\u003e fetched.json()).then(response =\u003e dispatch({type: 'REMOVE_USER', id: id}))\n});\n\nclass MyClazz extends Component {\n  @action\n  example() {\n    this.actions.remove();\n  }\n}\n\nexport default connect(stateToComputed, dispatchToActions)(MyClazz);\n```\n\n## How do I enable time travel debugging?\n\n1. Install the [redux dev tools extension].\n\n2. Enjoy!\n\n## Running Tests\n\n    yarn\n    ember test\n\n## License\n\nCopyright © 2019 Toran Billups https://toranbillups.com\n\nLicensed under the MIT License\n\n[build-badge]: https://travis-ci.org/ember-redux/ember-redux.svg?branch=master\n[build]: https://travis-ci.org/ember-redux/ember-redux\n\n[npm-badge]: https://img.shields.io/npm/v/ember-redux.svg?style=flat-square\n[npm]: https://www.npmjs.org/package/ember-redux\n\n[climate-badge]: https://codeclimate.com/github/ember-redux/ember-redux/badges/gpa.svg\n[climate]: https://codeclimate.com/github/ember-redux/ember-redux\n\n[score-badge]: https://emberobserver.com/badges/ember-redux.svg\n[score]: https://emberobserver.com/addons/ember-redux\n\n[downloads-badge]: https://img.shields.io/npm/dm/ember-redux.svg\n\n[redux]: https://github.com/reactjs/redux\n\n[redux dev tools extension]: https://github.com/zalmoxisus/redux-devtools-extension\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fember-redux%2Fember-redux","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fember-redux%2Fember-redux","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fember-redux%2Fember-redux/lists"}