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

Add query params to RouterState #56

@YoussefTaghlabi

Description

@YoussefTaghlabi

Currently, RouterState hosts only a path; It will be nice if it can host a queryParams object and enhance connectRouterActions to dispatch it.

// reducer.ts
export interface RouterState {
  path: string;
  queryParams: any;
}

// connect.ts
export function getQueryParams(router: Router): Observable<any> {
  // Get query params from router
  const queryParams  = ... ;
  return queryParams;
}


export function connectRouterActions(router: Router, store: Store<any>) {
  const queryParams = getQueryParams(router);
  ...
    return { type: routerActions.UPDATE_LOCATION, payload: { path, queryParams }};
 ....
}

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions