UNPKG

loop-modules

Version:

Shared modules for the Loop product suite.

39 lines (34 loc) 913 B
// libs import { Observable } from 'rxjs/Observable'; // app import { LoopTopic } from '../interfaces/loop-topic.interface'; /** * The AppState slice for persisting LoopTopic records * * @export * @interface LoopTopicState */ export interface LoopTopicState { /** * The collection of loaded LoopTopic entries from the back-end service * * @type {LoopTopic[]} */ entries?: LoopTopic[]; /** * The collection of selected LoopTopic entries * * @type {LoopTopic[]} The LoopTopic records */ selectedEntries?: LoopTopic[]; } export const initialState: LoopTopicState = { entries: [], selectedEntries: [] }; export function getTopics(state$: Observable<any>) { return state$.select(state => state.topics.entries); } export function getSelectedTopics(state$: Observable<any>) { return state$.select(state => state.topics.selectedEntries); }