Advertisement
Guest User

Untitled

a guest
Aug 24th, 2019
71
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.84 KB | None | 0 0
  1. export interface TalksState extends EntityState<Talk> {
  2. filters: Filters;
  3. watched: { [id: number]: boolean };
  4. }
  5.  
  6. export interface TalksPartialState {
  7. readonly talks: TalksState;
  8. }
  9.  
  10. export const talksAdapter: EntityAdapter<Talk> = createEntityAdapter<Talk>();
  11.  
  12. export const initialState: TalksState = talksAdapter.getInitialState({
  13. filters: { speaker: '', title: '', minRating: 0 },
  14. watched: {}
  15. });
  16.  
  17. const talksReducer = createReducer(
  18. initialState,
  19. // on(TalksActions.talksUpdated, (state, { talks, filters }) =>
  20. // on(TalksActions.talkUpdated, (state, { talk }) =>
  21. // on(TalksActions.rate, (state, { talkId, rating }) => {
  22. // on(TalksActions.unrate, (state, { talkId }) =>
  23. // on(TalksActions.watch, (state, { talkId }) =>
  24. );
  25.  
  26. export function reducer(state: TalksState | undefined, action: Action) {
  27. return talksReducer(state, action);
  28. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement