Guest User

Untitled

a guest
Jan 16th, 2018
90
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.47 KB | None | 0 0
  1. @Injectable()
  2. export class AppSandboxService {
  3. //Subscribe on new values from the store
  4. mobile$ = this.store.select(state => state.screen.mobile);
  5. tablet$ = this.store.select(state => state.screen.tablet);
  6. desktop$ = this.store.select(state => state.screen.desktop);
  7.  
  8. constructor(private store: Store<ApplicationState>) {
  9. }
  10.  
  11. setWindowWidth(windowWidth: number): void {
  12. //Send the new windowWitdth to the store
  13. this.store.dispatch(new SetScreen(windowWidth));
  14. }
  15. }
Add Comment
Please, Sign In to add comment