1.0.1 • Published 1 year ago

@ngx-stack/merge-http-context v1.0.1

Weekly downloads
-
License
MIT
Repository
github
Last release
1 year ago

@ngx-stack/merge-http-context

The utility library for merging multiple Angular HttpContexts.

Install

Install with npm:

$ npm install @ngx-stack/merge-http-context

Usage

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<any>{
        return this.http.get(URL, {
            context: mergeHttpContext(
                new HttpContext().set(ID_TOKEN, "some value"),
                CACHE_CONTEXT
            )
        });
    }
}
1.0.1

1 year ago

1.0.0

1 year ago