The utility library for merging multiple Angular `HttpContext`s.
npm install @ngx-stack/merge-http-contextThe utility library for merging multiple Angular HttpContexts.
Install with npm:
``sh`
$ npm install @ngx-stack/merge-http-context
`ts
import { mergeHttpContext } from "@ngx-stack/merge-http-context";
@Injectable()
export class AppService {
private cacheContext: HttpContext = new HttpContext().set(CACHE_TOKEN, true);
constructor(private http: HttpClient) {}
public getSomething(): Observable
return this.http.get(URL, {
context: mergeHttpContext(
new HttpContext().set(ID_TOKEN, "some value"),
CACHE_CONTEXT
)
});
}
}
``