Options
All
  • Public
  • Public/Protected
  • All
Menu

Class StoreModuleFactory

Hierarchy

  • StoreModuleFactory

Index

Constructors

constructor

Properties

_allItemsStateName

_allItemsStateName: string

_createAction

_createAction: string

_deleteAction

_deleteAction: string

_deleteMutation

_deleteMutation: string

_httpService

_httpService: HTTPService

_namespaced

_namespaced: boolean

_readAction

_readAction: string

_readAllGetter

_readAllGetter: string

_readByIdGetter

_readByIdGetter: string

_setAllAction

_setAllAction: string

_setAllMutation

_setAllMutation: string

_storageService

_storageService: StorageService

_updateAction

_updateAction: string

Accessors

allItemsStateName

  • get allItemsStateName(): string
  • set allItemsStateName(arg: string): any

createAction

  • get createAction(): string
  • set createAction(arg: string): any

deleteAction

  • get deleteAction(): string
  • set deleteAction(arg: string): any

deleteMutation

  • get deleteMutation(): string
  • set deleteMutation(arg: string): any

readAction

  • get readAction(): string
  • set readAction(arg: string): any

readAllGetter

  • get readAllGetter(): string
  • set readAllGetter(arg: string): any

readByIdGetter

  • get readByIdGetter(): string
  • set readByIdGetter(arg: string): any

setAllAction

  • get setAllAction(): string
  • set setAllAction(arg: string): any

setAllMutation

  • get setAllMutation(): string
  • set setAllMutation(arg: string): any

updateAction

  • get updateAction(): string
  • set updateAction(arg: string): any

Methods

createDefaultActions

  • createDefaultActions(endpoint?: string): {}
  • create default actions for the store if the endpoint is given it also generates actions for the endpoint

    Parameters

    • Optional endpoint: string

    Returns {}

    • [x: string]: (__namedParameters: { commit: any }, allData: any) => any
        • (__namedParameters: { commit: any }, allData: any): any
        • Parameters

          • __namedParameters: { commit: any }
            • commit: any
          • allData: any

          Returns any

createDefaultGetters

  • createDefaultGetters(): {}
  • create default getters for the store

    Returns {}

    • [x: string]: ((state: any) => any[]) | ((state: any) => (id: any) => any)

createDefaultMutations

  • createDefaultMutations(moduleName: string): {}
  • create default mutations for the store

    Parameters

    • moduleName: string

    Returns {}

    • [x: string]: (state: any, allData: any) => any
        • (state: any, allData: any): any
        • Parameters

          • state: any
          • allData: any

          Returns any

createDefaultState

  • createDefaultState(moduleName: string): {}
  • create default state for the store

    Parameters

    • moduleName: string

    Returns {}

    • [x: string]: {}

createDefaultStore

  • createDefaultStore(moduleName: string, endpoint?: string): { actions: {}; getters: {}; mutations: {}; namespaced: boolean; state: {} }
  • Generate a default store module

    Parameters

    • moduleName: string

      the name of the module

    • Optional endpoint: string

    Returns { actions: {}; getters: {}; mutations: {}; namespaced: boolean; state: {} }

    • actions: {}
      • [x: string]: (__namedParameters: { commit: any }, allData: any) => any
          • (__namedParameters: { commit: any }, allData: any): any
          • Parameters

            • __namedParameters: { commit: any }
              • commit: any
            • allData: any

            Returns any

    • getters: {}
      • [x: string]: ((state: any) => any[]) | ((state: any) => (id: any) => any)
    • mutations: {}
      • [x: string]: (state: any, allData: any) => any
          • (state: any, allData: any): any
          • Parameters

            • state: any
            • allData: any

            Returns any

    • namespaced: boolean
    • state: {}
      • [x: string]: {}

createExtraGetAction

  • createExtraGetAction(endpoint: string, options?: AxiosRequestConfig): {}
  • create a new action to add to the store which sends a get request

    Parameters

    • endpoint: string

      api endpoint

    • Optional options: AxiosRequestConfig

    Returns {}

    • [x: string]: (_: any, payload: any) => Promise<AxiosResponse<any>>
        • (_: any, payload: any): Promise<AxiosResponse<any>>
        • Parameters

          • _: any
          • payload: any

          Returns Promise<AxiosResponse<any>>

createExtraPostAction

  • createExtraPostAction(endpoint: string, actionName: string): {}
  • create a new action to add to the store which sends a post request

    Parameters

    • endpoint: string

      api endpoint

    • actionName: string

      the last part of the url

    Returns {}

    • [x: string]: (_: any, payload: any) => Promise<AxiosResponse<any>>
        • (_: any, payload: any): Promise<AxiosResponse<any>>
        • Parameters

          • _: any
          • payload: any

          Returns Promise<AxiosResponse<any>>

Generated using TypeDoc