Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
* Dependency Injection Improvements (#79) * Dependency Injection Improvements Updated API to fit better with Angular 2 DI. The main change here is to delay configuring the redux store until after the app has bootstrapped. So instead of doing: ```typescript import { provider } from 'ng2-redux'; bootstrap(App, [ provider(configureStore()) ]); ``` We instead do: ```typescript import { NgRedux } from 'ng2-redux'; bootstrap(App, [ NgRedux ]); @component({ // ... }) class App { constructor(private ngRedux: NgRedux) { ngRedux.attach(configureStore()); } } ``` This is desirable for two reasons: 1. We can now inject angular services into NgRedux itself 2. We can now inject angular services into redux middleware and store enhancers. (1) is needed to resolve the issue with redux dev tools store updates happening outside the angular zone. We need to be able to do an `applicationRef.tick()` on state update or the Angular UI doesn't respond to dev tool actions. Handling it internally this way is preferable to making the end user remember to hook it up manually. (2) is a major feature that is currently impossible in the old architecture, since previously the middleware needed to be applied to the store before the Angular DI was bootstrapped. I think this approach is much more in line with how people expect Angular 2 DI to function, and resolves a number of other thorny init problems. However it does represent an API change, and thus will require a major version bump if adopted. Also in this commit: - some minor code cleanup - switch to the more size-efficient rxjs import pattern - marked the `select` api as deprecated. * Added DI-injected middleware example with new DI strategy Also added redux-logger to the example app as an example of using vanilla middlewares from the redux ecosystem. * Added unit test for double store configuration error. * Added test for devtools update mechanism. * chore(*): Added linting with tslint, hooked it into CI (#84) * feat(decorators): select, dispatch, dispatchAll * chore(decorators): Move decorators (#91) * Move decorators to own folder * Create spec file for each decorator * Rename dispatchAll.ts -> dispatch-all.ts * Remove decorator spec from ngredux spec * chore(ngRedux): Change lodash imports (#92) * Instead of importing all of lodash, only import methods we need * docs(decorators): updated README.md * fix(@dispatch/All): arguments being passed as expected * chore(specs): improved decorator interface test suite (#95) * More v3 docs - Changelog details - Better DI action-creator example showing how `redux-thunk` is redundant in Angular 2. - Demonstrate `redux-logger` and `redux-localstorage` as community-provided middleware and enhancer in example app. Got rid of redux-thunk. * Fix linter error upon rebase from master * Resolve rebase conflict resolution error * Rebased from master to consume recent v2.x fixes. * Add missing doc updates. * typo fix * Prepare for 3.0 release. Removes the `@dispatch` and `@dispatchAll` decorators since they are still experimental. * v3.0 prep * Remove `@dispatch` and `@dispatchAll` ref from docs * Add Cosmin as contributer
- Loading branch information