X-Git-Url: https://git.arvados.org/arvados.git/blobdiff_plain/4b065bb111ccdfdde1756e6507b84b72ce67c511..40952ad86a823635968c9abc5d6feacef316cffd:/src/store/collections/creator/collection-creator-reducer.ts diff --git a/src/store/collections/creator/collection-creator-reducer.ts b/src/store/collections/creator/collection-creator-reducer.ts index 1a3cb0d2ea..72c999d0d1 100644 --- a/src/store/collections/creator/collection-creator-reducer.ts +++ b/src/store/collections/creator/collection-creator-reducer.ts @@ -4,14 +4,12 @@ import { collectionCreateActions, CollectionCreateAction } from './collection-creator-action'; -export type CollectionCreatorState = CollectionCreator; - -interface CollectionCreator { +export interface CollectionCreatorState { opened: boolean; ownerUuid: string; } -const updateCreator = (state: CollectionCreatorState, creator?: Partial) => ({ +const updateCreator = (state: CollectionCreatorState, creator?: Partial) => ({ ...state, ...creator }); @@ -21,7 +19,7 @@ const initialState: CollectionCreatorState = { ownerUuid: '' }; -export const collectionCreationReducer = (state: CollectionCreatorState = initialState, action: CollectionCreateAction) => { +export const collectionCreatorReducer = (state: CollectionCreatorState = initialState, action: CollectionCreateAction) => { return collectionCreateActions.match(action, { OPEN_COLLECTION_CREATOR: ({ ownerUuid }) => updateCreator(state, { ownerUuid, opened: true }), CLOSE_COLLECTION_CREATOR: () => updateCreator(state, { opened: false }),