Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
builder.withHandler(PutContest.TYPE, (state, payload) => setWith(state, { value: payload }));
builder.withHandler(DelContest.TYPE, () => ({ value: undefined }));
return sortNotes(state.map(note => {
if (note.id !== payload.noteId) {
return note;
}
return setWith(note, { content: payload.content, modified: new Date() });
}));
});
builder.withHandler(PutCourse.TYPE, (state, payload) => setWith(state, { value: payload }));
builder.withHandler(DelCourse.TYPE, () => ({ value: undefined }));
builder.withHandler(PutCourseChapter.TYPE, (state, payload) => setWith(state, payload));
builder.withHandler(DelCourseChapter.TYPE, () => ({ value: undefined, name: undefined }));
builder.withHandler(PutGradingLanguage.TYPE, (state, gradingLanguage) => setWith(state, { gradingLanguage }));
builder.withDefaultHandler(state => (state !== undefined ? state : INITIAL_STATE));
builder.withHandler(PutUser.TYPE, (state, payload) => setWith(state, { user: payload }));
builder.withHandler(DelSession.TYPE, () => INITIAL_STATE);