Last active
May 10, 2016 15:32
-
-
Save borisd/802117796c90d4a15431f734f2a7100c to your computer and use it in GitHub Desktop.
using.ts
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
export class Connect { | |
private _store; | |
public unsubscribe; | |
public state; | |
constructor(store) { | |
this._store = store; | |
this.state = store.getState(); | |
} | |
ngOnInit():any { | |
this.unsubscribe = this._store.subscribe( () => this.state = this._store.getState()); | |
} | |
ngOnDestroy():any { | |
this. unsubscribe() | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment