Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- @Injectable()
- export class AppSandboxService {
- //Subscribe on new values from the store
- mobile$ = this.store.select(state => state.screen.mobile);
- tablet$ = this.store.select(state => state.screen.tablet);
- desktop$ = this.store.select(state => state.screen.desktop);
- constructor(private store: Store<ApplicationState>) {
- }
- setWindowWidth(windowWidth: number): void {
- //Send the new windowWitdth to the store
- this.store.dispatch(new SetScreen(windowWidth));
- }
- }
Add Comment
Please, Sign In to add comment