Skip to content

Instantly share code, notes, and snippets.

Daan Scheerens dscheerens

Block or report user

Report or block dscheerens

Hide content and notifications from this user.

Learn more about blocking users

Contact Support about this user’s behavior.

Learn more about reporting abuse

Report abuse
View GitHub Profile
dscheerens / injection-token-factory-builder.ts
Created Aug 15, 2019
Builder pattern applied to InjectionToken factory functions
View injection-token-factory-builder.ts
// ========================================
// app-module.ts
// ========================================
import { BrowserModule } from '@angular/platform-browser';
import { NgModule } from '@angular/core';
import { AppComponent } from './app.component';
import { NumbersModule } from './numbers';
dscheerens / observe-property.ts
Last active Sep 30, 2019
Property observe function
View observe-property.ts
import { BehaviorSubject, Observable } from 'rxjs';
* Observes the specified property and returns a stream that emits all values which are assigned to the property. When subscribing to the
* resulting stream it will always first emit the current value of the property, followed by all new values that are assigned to it.
* @param target Object containing the property.
* @param key Key of the property that is to be observed.
* @returns A stream of all values that are assigned to the specified property, starting with the current value of the property.
You can’t perform that action at this time.