Skip to content

Instantly share code, notes, and snippets.

@fireflysemantics
Last active December 17, 2019 01:03
Show Gist options
  • Save fireflysemantics/f57c67644da2a46d629461dba3d4d18a to your computer and use it in GitHub Desktop.
Save fireflysemantics/f57c67644da2a46d629461dba3d4d18a to your computer and use it in GitHub Desktop.
import { ACTIVE_MENU_KEY, MENU_ITEMS } from './model';
import { Injectable, OnDestroy } from '@angular/core';
import { OStore} from "@fireflysemantics/slice";
import { Observable } from "rxjs";
@Injectable({
providedIn: 'root'
})
export class StateService {
public ostore:OStore = new OStore();
public activeMenu$:Observable<string>;
constructor() {
this.ostore.post(
ACTIVE_MENU_KEY,
MENU_ITEMS.BLOG);
this.activeMenu$ = this.ostore.observe(ACTIVE_MENU_KEY);
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment