store

Angular 2+ bindings for Redux

Github星跟蹤圖

REPO DEPRECATED

Please note that this repo has been deprecated. Code and issues are being migrated to a monorepo at https://github.com/angular-redux/platform where we are beginning work on a new and improved v10. To file any new issues or see the state of the current code base, we would love to see you there! Thanks for your support!

Which Version to use?

Angular 6+

@angular-redux/store@^9 is what you need. This consumes breaking changes from RxJS and Angular 6, as well as updated typedefs from Redux 4.

Angular 5

Use @angular-redux/store@^7 - this version supports Angular 5, and also changes to using lettable operators.

Angular 4 or lower

Use @angular-redux/store@^6 - This supports Angular 4 and earlier.

Support for @angular-redux/store@6?

Where possible, I will be maintaining and applying any fixes / enhancements for v7 into v6 where it does not introduce a breaking change.

I made a few mistakes trying to publish fixes / etc to two major versions, which caused some releases to get tagged incorrectly and caused some confusion. Sorry for any confusion this has caused, and will do better on avoiding this in the future, and being more transparent with the releases that are going out.

@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':
  • clone the example app (git clone https://github.com/angular-redux/example-app.git)
  • generate a 'local package' (cd to your angular-redux/store clone and run npm pack). This will create a .tgz file.
  • 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)
  • run ng serve --aot

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

主要指標

概覽
名稱與所有者angular-redux/store
主編程語言TypeScript
編程語言TypeScript (語言數: 2)
平台
許可證MIT License
所有者活动
創建於2015-08-14 01:42:56
推送於2019-05-05 16:20:29
最后一次提交2018-07-13 16:24:18
發布數98
最新版本名稱v7.1.0 (發布於 2018-01-20 14:33:27)
第一版名稱v2.0.0-alpha (發布於 )
用户参与
星數1.3k
關注者數57
派生數202
提交數359
已啟用問題?
問題數287
打開的問題數63
拉請求數243
打開的拉請求數5
關閉的拉請求數33
项目设置
已啟用Wiki?
已存檔?
是復刻?
已鎖定?
是鏡像?
是私有?