typescript

Signed-off-by: marcin mikołajczak <git@mkljczk.pl>
This commit is contained in:
marcin mikołajczak 2022-04-14 17:50:47 +02:00
parent 23943ccdee
commit 92a6058f26
1 changed files with 13 additions and 8 deletions

View File

@ -1,4 +1,5 @@
import { Map as ImmutableMap } from 'immutable';
import { Record as ImmutableRecord } from 'immutable';
import { AnyAction } from 'redux';
import {
ACCOUNT_NOTE_INIT_MODAL,
@ -8,15 +9,19 @@ import {
ACCOUNT_NOTE_SUBMIT_SUCCESS,
} from '../actions/account_notes';
const initialState = ImmutableMap({
edit: ImmutableMap({
isSubmitting: false,
account: null,
comment: null,
}),
const EditRecord = ImmutableRecord({
isSubmitting: false,
account: null,
comment: null,
});
export default function account_notes(state = initialState, action) {
const ReducerRecord = ImmutableRecord({
edit: EditRecord(),
});
type State = ReturnType<typeof ReducerRecord>;
export default function account_notes(state: State = ReducerRecord(), action: AnyAction) {
switch (action.type) {
case ACCOUNT_NOTE_INIT_MODAL:
return state.withMutations((state) => {