Skip to content
This repository has been archived by the owner on Jul 27, 2018. It is now read-only.

docs(readme): add parts on app state and dispatching actions #8

Merged
merged 7 commits into from
Aug 26, 2016
Merged

docs(readme): add parts on app state and dispatching actions #8

merged 7 commits into from
Aug 26, 2016

Conversation

BrainCrumbz
Copy link
Contributor

Not totally sure about the need for adding router: to application state, but the one for dispatching actions is needed. Also, the description in original PR #5 has a typo in the import.

Not totally sure about the need for adding `router:` to application state, but the one for dispatching actions is needed. Also, the description in original PR #5 has a typo in the `import`.
import {routerActions} from '@ngrx/store-store';

// ...
store.dispatch(routerActions.go('/path', { query: 'string' ));
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@brandonroberts Query params can still be an object, right? Or do they have to be a string?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Not sure about that, took it from original PR comments. OT: routerActions there seems wrong, it's still as it was before: import { go } from '@ngrx/router-store';: will update now.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Although, looking at code, yes: query is an optional any, so you're right

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Query params have to be an object. Will you add the other actions you can dispatch (show, back, forward)?

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I consider adding the RouterState interface to be optional. Thoughts @MikeRyan52 ?

Copy link
Contributor Author

@BrainCrumbz BrainCrumbz Aug 26, 2016

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Will you add the other actions you can dispatch (show, back, forward)?

Didn't think about making that exhaustive, but why not ...

About query params, shouldn't they strictly be of type NavigationExtras? Or at least, should the documentation hint at those query params and state where they will end up (i.e., to router.navigate(... , *here*)?

// ...
store.dispatch(go('/path', { query: 'string' }));
store.dispatch(replace('/path', { query: 'string' }));
store.dispatch(search({ query: 'string' ));
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This example is missing a closing brace

@brandonroberts brandonroberts merged commit cf6d364 into ngrx:master Aug 26, 2016
@brandonroberts
Copy link
Member

Thanks!

@BrainCrumbz BrainCrumbz deleted the docs/readme-actions branch August 26, 2016 23:54
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants