-
-
Notifications
You must be signed in to change notification settings - Fork 3
Open
Description
Description
when I try to upgrade from akita-ng-router-store, I have using selectParams which the parameter is an optional and there have no problem because when the parameter is undefined, selectParams still will emit the value, but elf-ng-router-store not supporting this. I want to suggest remove the filterNil operator from the selectParams method.
Proposed solution
selectParams<T extends string>(
names?: string | string[]
): Observable<T | T[] | Params | null> {
if (names === undefined) {
return store.pipe(sliceState('params'));
}
const _select = (p: string) =>
store.pipe(
sliceState<RouterState>('params'),
pluck(p),
filterNil() <--- remove this line
);
if (Array.isArray(names)) {
const sources = names.map(_select);
return combineLatest(sources);
}
return _select(names).pipe(distinctUntilChanged());
}
Alternatives considered
no other alternatives
Do you want to create a pull request?
No
Metadata
Metadata
Assignees
Labels
No labels