Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix(RouterStore): don't navigate on NavigationStart router event #1378

Closed
wants to merge 71 commits into from

Conversation

timdeschryver
Copy link
Member

PR Checklist

Please check if your PR fulfills the following requirements:

PR Type

What kind of change does this PR introduce?

[x] Bugfix
[ ] Feature
[ ] Code style update (formatting, local variables)
[ ] Refactoring (no functional changes, no api changes)
[ ] Build related changes
[ ] CI related changes
[ ] Documentation content changes
[ ] Other... Please describe:

What is the current behavior?

Issue Number: #1373

What is the new behavior?

Does this PR introduce a breaking change?

[ ] Yes
[x] No

Other information

Closes #1373

koumatsumoto and others added 30 commits August 3, 2018 13:14
…moved (#1240)

BREAKING CHANGE:

BEFORE:
```ts
{type: '@ngrx/store/update-reducers', feature: 'feature1'}
{type: '@ngrx/store/update-reducers', feature: 'feature2'}
```

AFTER:
```ts
{type: '@ngrx/store/update-reducers', features: ['feature1',
'feature2']}
```
We can't link directly to https://stackblitz.com/github/ngrx/platform due to
schematics source files being parsed as TypeScript files. This generates an HTML file that will open with just the example application.

Closes #1215
BREAKING CHANGE:

The default state key is changed from routerReducer to router
…rnal router hook, more typesafety for router state
BREAKING CHANGE:

StoreRouterConfigFunction is removed. It is no longer possible to pass a function returning a StoreRouterConfig to StoreRouterConnectingModule.forRoot

If you still need this, pass a provider like this:
{
      provide: ROUTER_CONFIG,
      useFactory: _createRouterConfig // you function
}
lint staged was processing all files with the update it only processes the modified files
peterbsmyth and others added 25 commits August 31, 2018 16:12
this does not fix the issue but makes it more readable
It is based on TS2.8 introduced conditional types. Upgrade package.json
to that version.

Also remove the deprecated non-pipable version of `ofType` so that we
don't have to keep complicated types in two places.

Fixes some tests post removal of non-pipeable version.

Original implementation by @mtaran-google.

BREAKING CHANGES:

Removes .ofType method on Actions. Instead use the provided 'ofType'
rxjs operator.

BEFORE:
```
this.actions.ofType('INCREMENT')
```

AFTER:

```
import { ofType } from '@ngrx/store';
...
this.action.pipe(ofType('INCREMENT'))
```
Introduces `@ngrx/store/testing` that provides a mock store for using in test setup

Closes #915 

```ts
import { Store } from '@ngrx/store';
import { provideMockStore, MockStore } from '@ngrx/store/testing';
import { take } from 'rxjs/operators';

describe('Mock Store', () => {
  let mockStore: MockStore<{ counter1: number, counter2: number }>;

  beforeEach(() => {
    const initialState = { counter1: 0, counter2: 1 };

    TestBed.configureTestingModule({
      providers: [provideMockStore({ initialState })],
    });

    mockStore = TestBed.get(Store);
  });

  it('should set the new state', () => {
    mockStore.setState({ counter1: 1, counter2: 2 });

    mockStore.pipe(take(1)).subscribe(state => {
      expect(state.counter1).toBe(1);
    });
  });
});
```
@timdeschryver timdeschryver changed the base branch from master to 6.1.x October 25, 2018 18:04
@timdeschryver
Copy link
Member Author

I started from the wrong branch, one second... 😅

@timdeschryver timdeschryver deleted the pr/nagivation-start branch March 27, 2019 21:35
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.