Press n or j to go to the next uncovered block, b, p or k for the previous block.
| 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 | 32x 32x 32x 32x 32x 32x 32x 32x 5x | import { EntityState, createEntityAdapter } from '@ngrx/entity';
import { createReducer, on } from '@ngrx/store';
import { ContentPagelet } from 'ish-core/models/content-pagelet/content-pagelet.model';
import { loadContentIncludeSuccess } from 'ish-core/store/content/includes/includes.actions';
import { loadContentPageSuccess } from 'ish-core/store/content/pages/pages.actions';
import { loadViewContextEntrypointSuccess } from 'ish-core/store/content/viewcontexts/viewcontexts.actions';
export type PageletsState = EntityState<ContentPagelet>;
export const pageletsAdapter = createEntityAdapter<ContentPagelet>();
const initialState = pageletsAdapter.getInitialState();
export const pageletsReducer = createReducer(
initialState,
on(loadContentIncludeSuccess, (state, action) => pageletsAdapter.upsertMany(action.payload.pagelets, state)),
on(loadContentPageSuccess, (state, action) => pageletsAdapter.upsertMany(action.payload.pagelets, state)),
on(loadViewContextEntrypointSuccess, (state, action) => pageletsAdapter.upsertMany(action.payload.pagelets, state))
);
|