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 22 23 24 25 26 | 32x 32x 32x 32x 22x 32x 32x 11x 11x | import { EntityState, createEntityAdapter } from '@ngrx/entity';
import { createReducer, on } from '@ngrx/store';
import { ContentPageletEntryPoint } from 'ish-core/models/content-pagelet-entry-point/content-pagelet-entry-point.model';
import { loadContentIncludeSuccess } from './includes.actions';
export const includesAdapter = createEntityAdapter<ContentPageletEntryPoint>({
selectId: contentInclude => contentInclude.id,
});
export type IncludesState = EntityState<ContentPageletEntryPoint>;
const initialState: IncludesState = includesAdapter.getInitialState({});
export const includesReducer = createReducer(
initialState,
on(loadContentIncludeSuccess, (state, action) => {
const { include } = action.payload;
return {
...includesAdapter.upsertOne(include, state),
};
})
);
|