MCPcopy Index your code
hub / github.com/angular-redux/store

github.com/angular-redux/store @v8.0.0-1

Chat with this repo
repository ↗ · DeepWiki ↗ · release v8.0.0-1 ↗ · + Follow
210 symbols 431 edges 33 files 6 documented · 3%
What it actually does AI analysis from the code graph — generated when you open this
loading…
README

@angular-redux/store

Angular bindings for Redux.

For Angular 1 see ng-redux

Join the chat at https://gitter.im/angular-redux/ng2-redux CircleCI npm version downloads per month

What is Redux?

Redux is a popular approach to managing state in applications. It emphasises:

  • A single, immutable data store.
  • One-way data flow.
  • An approach to change based on pure functions and a stream of actions.

You can find lots of excellent documentation here: Redux.

What is @angular-redux?

We provide a set of npm packages that help you integrate your redux store into your Angular 2+ applications. Our approach helps you by bridging the gap with some of Angular's advanced features, including:

  • Change processing with RxJS observables.
  • Compile time optimizations with NgModule and Ahead-of-Time compilation.
  • Integration with the Angular change detector.

Getting Started

Examples

Here are some examples of the angular-redux family of packages in action:

Companion Packages

Resources

In-Depth Usage

@angular-redux/store uses an approach to redux based on RxJS Observables to select and transform data on its way out of the store and into your UI or side-effect handlers. Observables are an efficient analogue to reselect for the RxJS-heavy Angular world.

Read more here: Select Pattern

We also have a number of 'cookbooks' for specific Angular topics:

Hacking on angular-redux/store

Want to hack on angular-redux/store or any of the related packages? Feel free to do so, but please test your changes before making any PRs.

Here's how to do that:

  1. Write unit tests. You can check that they work by running npm test.
  2. Run the linter. If your editor doesn't do it automatically, do it manually with npm run lint.
  3. Test your changes in a 'real world scenario'. We use the example-app for this, using some npm fakery to 'publish the package locally':

  4. clone the example app (git clone https://github.com/angular-redux/example-app.git)

  5. generate a 'local package' (cd to your angular-redux/store clone and run npm pack). This will create a .tgz file.
  6. hook your 'local package' up to your example-app (cd to your example-app clone and run npm install --save /path/to/the/tgz/file/from/above)
  7. run ng serve --aot

Please make sure your changes pass Angular's AoT compiler, because it's a bit finicky with TS syntax.

Extension points exported contracts — how you extend this code

ObservableStore (Interface)
(no doc)
src/components/observable-store.ts
IAppState (Interface)
(no doc)
src/decorators/select.spec.ts
SelectorStubRecord (Interface)
(no doc)
testing/observable-store.mock.ts
ISubState (Interface)
(no doc)
src/components/sub-store.spec.ts
IFractalStoreOptions (Interface)
(no doc)
src/decorators/helpers.ts
SelectorStubMap (Interface)
(no doc)
testing/observable-store.mock.ts
IAppState (Interface)
(no doc)
src/components/sub-store.spec.ts
IAppState (Interface)
(no doc)
src/decorators/dispatch.spec.ts

Core symbols most depended-on inside this repo

n
called by 45
docs/assets/js/main.js
getIn
called by 34
src/utils/get-in.ts
select
called by 25
src/decorators/select.ts
WithSubStore
called by 21
src/decorators/with-sub-store.ts
$
called by 18
docs/assets/js/main.js
e
called by 18
docs/assets/js/main.js
ob
called by 17
docs/assets/js/main.js
b
called by 15
docs/assets/js/main.js

Shape

Function 139
Class 45
Method 15
Interface 11

Languages

TypeScript100%

Modules by API surface

docs/assets/js/main.js97 symbols
src/decorators/select.spec.ts13 symbols
src/decorators/helpers.ts11 symbols
src/decorators/with-sub-store.spec.ts10 symbols
src/components/root-store.spec.ts10 symbols
src/decorators/dispatch.spec.ts9 symbols
testing/observable-store.mock.ts7 symbols
testing/ng-redux.mock.ts7 symbols
src/components/sub-store.spec.ts5 symbols
src/components/fractal-reducer-map.ts5 symbols
src/decorators/select.ts4 symbols
src/components/root-store.ts4 symbols

For agents

$ claude mcp add store \
  -- python -m otcore.mcp_server <graph>

⬇ download graph artifact