{"id":22373802,"url":"https://github.com/objective-redux/objective-redux","last_synced_at":"2025-07-30T21:32:52.380Z","repository":{"id":38993026,"uuid":"268160458","full_name":"Objective-Redux/Objective-Redux","owner":"Objective-Redux","description":"Redux made better, objectively.","archived":false,"fork":false,"pushed_at":"2023-03-06T16:29:46.000Z","size":18909,"stargazers_count":5,"open_issues_count":37,"forks_count":1,"subscribers_count":2,"default_branch":"main","last_synced_at":"2024-12-04T21:14:18.549Z","etag":null,"topics":["hooks","object-oriented","react","reactjs","redux","redux-helper","redux-saga","redux-tools","redux-wrapper","slice"],"latest_commit_sha":null,"homepage":null,"language":"TypeScript","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/Objective-Redux.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":"2020-05-30T21:11:19.000Z","updated_at":"2024-09-25T21:37:51.000Z","dependencies_parsed_at":"2023-02-12T14:46:47.010Z","dependency_job_id":null,"html_url":"https://github.com/Objective-Redux/Objective-Redux","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/Objective-Redux%2FObjective-Redux","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Objective-Redux%2FObjective-Redux/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Objective-Redux%2FObjective-Redux/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Objective-Redux%2FObjective-Redux/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/Objective-Redux","download_url":"https://codeload.github.com/Objective-Redux/Objective-Redux/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":228192341,"owners_count":17882756,"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":["hooks","object-oriented","react","reactjs","redux","redux-helper","redux-saga","redux-tools","redux-wrapper","slice"],"created_at":"2024-12-04T21:14:21.398Z","updated_at":"2024-12-04T21:14:22.892Z","avatar_url":"https://github.com/Objective-Redux.png","language":"TypeScript","readme":"# Objective Redux\n### Redux made better, objectively.\n\n\u003ca href=\"https://www.npmjs.com/package/objective-redux\"\u003e\u003cimg src=\"https://img.shields.io/npm/v/objective-redux\" alt=\"NPM Version\" /\u003e\u003c/a\u003e\n\u003ca href=\"./LICENSE\"\u003e\u003cimg src=\"https://img.shields.io/badge/license-MIT-blue.svg\" alt=\"License\" /\u003e\u003c/a\u003e\n\u003ca href=\"./dist\"\u003e\u003cimg src=\"https://badgen.net/npm/types/objective-redux\" alt=\"Types included\" /\u003e\u003c/a\u003e\n\u003cbr /\u003e\n\u003ca href=\"https://bundlephobia.com/result?p=objective-redux\"\u003e\u003cimg src=\"https://badgen.net/bundlephobia/minzip/objective-redux\" alt=\"bundle size\" /\u003e\u003c/a\u003e\n\u003ca href=\"https://github.com/Objective-Redux/Objective-Redux/actions\"\u003e\u003cimg src=\"https://github.com/Objective-Redux/Objective-Redux/workflows/Build/badge.svg\" alt=\"build status\" /\u003e\u003c/a\u003e\n\nMake organizing and managing your Redux store easy.\n\n\u003cbr /\u003e\n\n\u003cbr /\u003e\n\n# Meet your new Redux API\n\n## Install\n\n```\nnpm install --save redux redux-saga objective-redux\n```\n\n## Setup (for React)\n```javascript\nimport React from 'react';\nimport ReactDOM from 'react-dom';\nimport { ObjectiveStoreProvider, ObjectiveStore } from 'objective-redux';\nimport App from './app';\n\nexport const objectiveStore = new ObjectiveStore();\n\nReactDOM.render(\n  \u003cObjectiveStoreProvider objectiveStore={objectiveStore}\u003e\n    \u003cApp /\u003e\n  \u003c/ObjectiveStoreProvider\u003e,\n  document.getElementById('root')\n);\n```\n\n## Example Slice\n```javascript\nimport { StateController } from 'objective-redux';\n\nconst initialState = { isOn: false };\n\nexport class SwitchStateController extends StateController {\n  constructor() {\n    super(initialState);\n  }\n\n  static getName() {\n    return 'switch';\n  }\n\n  setSwitch = this.createReducingAction(\n    (state, isOn) =\u003e ({ isOn })\n  );\n}\n```\n```javascript\nSwitchStateController.getInstance(objectiveStore).setSwitch(true);\n```\n\n\u003cbr /\u003e\n\n\u003cbr /\u003e\n\n# Start using it now\n\nYou can read the \u003ca href=\"https://objective-redux.github.io/Objective-Redux/\"\u003efull documentation\u003c/a\u003e for more detailed information, along with examples.\n\n\u003ca href=\"https://objective-redux.github.io/Objective-Redux/\" alt=\"documentation website screenshot\"\u003e\u003cimg src=\"./statics/docs.png\" style=\"width: 100%\"\u003e\u003c/a\u003e\n\nIn addition, you can take a look at the \u003ca href=\"./examples\"\u003eexample apps\u003c/a\u003e in the project's \u003ca href=\"https://github.com/Objective-Redux/Objective-Redux/\"\u003eGitHub repository\u003c/a\u003e.\n\n\u003cbr /\u003e\n\n\u003cbr /\u003e\n\n# Why use Objective Redux?\n\n\u003cbr /\u003e\n\n## Drop the boilerplate code\n\n### Actions are a thing of the past\u0026mdash; among other things\n\nObject Redux largely removes the need for action names, actions, switch-statement-reducers, selectors, and dispatching. You just need to write the mutating functions. Objective Redux can take it from there.\n\n```typescript\n  // Define your mutation and forget about the rest.\n  myAction = this.createReducingAction(\n    (state, payload) =\u003e ({\n      ...state,\n      value: payload.value,\n    })\n  );\n```\n\n\u003cbr /\u003e\n\n## Easy Debugging\n\n### No more global searches for action names\n\nUsing Objective Redux, your editor knows exactly where to find everything. That means you get intellisense, jump to definition, and more. Plus, your actions and reducer will never get out-of-sync.\n\n\u003cp style=\"text-align: center;\"\u003e\n  \u003cimg src=\"./statics/debugging.png\" alt=\"Debugging in VS Code\" style=\"height: 500px;\" /\u003e\n\u003c/p\u003e\n\n\u003cbr /\u003e\n\n## Powerful code splitting and lazy loading\n\n### Get the pieces of state you need, when you need them\n\nStop wiring-up your reducers and sagas manually. And, for that matter, stop using large middleware package to help. Objective Redux will take care of it for you, and it will do it on demand, dynamically, at runtime. Your store no longer needs to know about what's in it, leaving you free to move parts around as needed.\n\n\u003cimg src=\"./statics/lazy.png\" alt=\"Lazy load reducers and controller when you need them\" style=\"height: 200px;\" /\u003e\n\nYou can even use the pre-dispatch hook to load bundles when an action is fired. This allows you to fire actions that target controllers that haven't been downloaded, yet.\n\n\u003cimg src=\"./statics/pre-dispatch-hook.png\" alt=\"Load bundles at runtime when an action targets a controller in the bundle\" style=\"height: 200px;\" /\u003e\n\nSee the \u003ca href=\"https://objective-redux.github.io/Objective-Redux/code-splitting.html\"\u003eCode Splitting\u003c/a\u003e and \u003ca href=\"https://objective-redux.github.io/Objective-Redux/lazy-loading-webpack-modules.html\"\u003eLazy Loading\u003c/a\u003e topics in the documentation for more.\n\n\u003cbr /\u003e\n\n## Organize your state\n\n### One slice, one object\n\nEach controller class represents a slice, giving an intuitive way for developers to look at and conceptualize the state.\n\nA slice of state never needs to know about what other slices are doing or how they're organized.\n\n\u003cimg src=\"./statics/organize.png\" alt=\"organize reducing function into a single class that represents a slice\" style=\"height: 200px;\" /\u003e\n\n\u003cbr /\u003e\n\n## Keep your dependencies simple\n\n### No direct dependencies\n\nObjective Redux only requires peer dependencies on [Redux](https://www.npmjs.com/package/redux) and [React](https://www.npmjs.com/package/react).\n\nOptionally, you can also add [Redux-Saga](https://www.npmjs.com/package/redux-saga) for StatelessControllers.\n\n\u003cbr /\u003e\n\n## Keep your bundle small\n### Lots of features, one small package\n\nObjective Redux replaces many of the packages you're already using.\n\nFor example, instead of React-Redux + Redux-Injectors + Redux-Toolkit\n\n\u003ca href=\"https://bundlephobia.com/result?p=react-redux\"\u003e\u003cimg src=\"https://badgen.net/bundlephobia/min/react-redux\" alt=\"react-redux bundle size\" /\u003e\u003c/a\u003e\n+\n\u003ca href=\"https://bundlephobia.com/result?p=redux-injectors\"\u003e\u003cimg src=\"https://badgen.net/bundlephobia/min/redux-injectors\" alt=\"redux-injectors bundle size\" /\u003e\u003c/a\u003e\n+\n\u003ca href=\"https://bundlephobia.com/result?p=redux-toolkit\"\u003e\u003cimg src=\"https://badgen.net/bundlephobia/min/redux-toolkit\" alt=\"redux-toolkit bundle size\" /\u003e\u003c/a\u003e\n\nyou can simply use Objective Redux\n\n\u003ca href=\"https://bundlephobia.com/result?p=objective-redux\"\u003e\u003cimg src=\"https://badgen.net/bundlephobia/min/objective-redux\" alt=\"objective-redux bundle size\" /\u003e\u003c/a\u003e\n\n_Bundle sizes vary based on how much of the package is unused and how effectively your bundler can remove the unused portions._\n\n\u003cbr /\u003e\n\n## Compatible with React-Redux\n\n### Migrate over time\nYou can use Objective Redux and React-Redux together. The ObjectiveStore is a decorated Redux store object and can be used to `dispatch`, `subscribe`, `getState`, and even `replaceReducer`. Simply pass the ObjectiveStore to the React-Redux provider and use it normally.\n\nSee the \u003ca href=\"https://objective-redux.github.io/Objective-Redux/use-with-react-redux.html\"\u003eUse with React-Redux\u003c/a\u003e topic in the documentation for more.\n\n\u003cbr /\u003e\n\n## Multiple ways to connect\n\n### Inject properties or use hooks\n\nYou can connect your components to Objective Redux to inject props from the store. Or, skip the connection process and use React hooks, instead.","funding_links":[],"categories":[],"sub_categories":[],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fobjective-redux%2Fobjective-redux","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fobjective-redux%2Fobjective-redux","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fobjective-redux%2Fobjective-redux/lists"}