MCPcopy Create free account
hub / github.com/ReactiveX/rxjs / setSearch

Method setSearch

apps/rxjs.dev/src/app/shared/location.service.ts:82–90  ·  view source on GitHub ↗
(label: string, params: { [key: string]: string|undefined})

Source from the content-addressed store, hash-verified

80 }
81
82 setSearch(label: string, params: { [key: string]: string|undefined}) {
83 const search = Object.keys(params).reduce((acc, key) => {
84 const value = params[key];
85 return (value === undefined) ? acc :
86 acc += (acc ? '&' : '?') + `${encodeURIComponent(key)}=${encodeURIComponent(value)}`;
87 }, '');
88
89 this.platformLocation.replaceState({}, label, this.platformLocation.pathname + search);
90 }
91
92 /**
93 * Handle user's anchor click

Callers 4

hideSearchResultsMethod · 0.80
selectGroupMethod · 0.80
setLocationSearchMethod · 0.80

Calls 1

reduceMethod · 0.45

Tested by

no test coverage detected