Created
July 15, 2018 04:56
-
-
Save YonathanMeguira/7fcf92df7d89a5e69b12c67813753d33 to your computer and use it in GitHub Desktop.
store.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
import { Injectable } from '@angular/core'; | |
import { EntityState, EntityStore } from '@datorama/akita'; | |
import { List } from './shopping-list.model'; | |
import { config } from '@datorama/akita'; | |
export interface ListState extends EntityState<List> {} | |
export interface ItemState extends EntityState<List> {} | |
@Injectable({ | |
providedIn: 'root' | |
}) | |
@config({ | |
name: 'list' | |
} | |
export class ListStore extends EntityStore<ListState, List> { | |
constructor() { | |
super(); | |
} | |
} | |
@config({ | |
name: 'item' | |
}) | |
export class ItemStore extends EntityStore<ItemState, Item> { | |
constructor() { | |
super(); | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment