import { Dispatch } from 'redux' ; import { FileItem } from '../../common/Types' ; import { ActionType , Folder } from '../RendererTypes' ; returns export const requestEnumItems = ( ) => ( { type : ActionType . RequestEnumItems } ) ; param folderPath param items returns export const finishEnumItems = ( folder , items ) => ( { type : ActionType . FinishEnumItems as typeof ActionType . FinishEnumItems , payload : { folder , items } } ) ; param folder export const enumItems = ( folder ) => async ( dispatch ) => { dispatch ( requestEnumItems ( ) ) ; const items = await window . myAPI . enumItems ( folder . path ) ; dispatch ( finishEnumItems ( folder , items ) ) ; } ;