Signed-off-by: marcin mikołajczak <git@mkljczk.pl>
next-virtuoso
marcin mikołajczak 2 years ago
parent 23943ccdee
commit 92a6058f26

@ -1,4 +1,5 @@
import { Map as ImmutableMap } from 'immutable'; import { Record as ImmutableRecord } from 'immutable';
import { AnyAction } from 'redux';
import { import {
ACCOUNT_NOTE_INIT_MODAL, ACCOUNT_NOTE_INIT_MODAL,
@ -8,15 +9,19 @@ import {
ACCOUNT_NOTE_SUBMIT_SUCCESS, ACCOUNT_NOTE_SUBMIT_SUCCESS,
} from '../actions/account_notes'; } from '../actions/account_notes';
const initialState = ImmutableMap({ const EditRecord = ImmutableRecord({
edit: ImmutableMap({
isSubmitting: false, isSubmitting: false,
account: null, account: null,
comment: 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) { switch (action.type) {
case ACCOUNT_NOTE_INIT_MODAL: case ACCOUNT_NOTE_INIT_MODAL:
return state.withMutations((state) => { return state.withMutations((state) => {
Loading…
Cancel
Save