loop-modules
Version:
Shared modules for the Loop product suite.
29 lines (25 loc) • 667 B
text/typescript
// libs
import { Observable } from 'rxjs/Observable';
// app
import { LoopSession } from '../interfaces/loop-session.interface';
import { AppState } from './app.state';
/**
* The AppState slice for persisting LoopSession records
*
* @export
* @interface LoopSessionState
*/
export interface LoopSessionState {
/**
* The collection of loaded LoopSession entries from the back-end service
*
* @type {LoopSession[]}
*/
entries?: LoopSession[];
}
export const initialState: LoopSessionState = {
entries: []
};
export function getSessions(state$: Observable<AppState>) {
return state$.select(state => state.sessions.entries);
}