makeCollectionProvider

Methods

(inner) makeCollectionProvider(name, optionsopt, idKeyopt) → {CollectionHoax}

Source:

makeCollectionProvider factory.

Parameters:
Name Type Attributes Default Description
name string

The name of the resource, will be used on the displayName.

options object <optional>
{}

The collection options.

Properties
Name Type Description
getInitialState object

The returned value of getInitialState of the collection, will be merged with the default collection hoax initialState.

reducer function

reducer(state, action) An extra reducer for the collection, should return nothing on actionType mismatch, after passing through the custom reducer, it will go through the default collection hoax reducer.

actions object

Extra actions, check the default hoax actions for collection and nested resources.

resourceOptions object

each nested resource's options

Properties
Name Type Description
getInitialState object

The returned value of getInitialState of the nested resource, will be merged with the default resource hoax initialState.

reducer function

reducer(state, action) An extra reducer for the nested resource, should return nothing on actionType mismatch, after passing through the custom reducer, it will go through the default resource reducer.

idKey string <optional>
'id'

The identifier for resource scoping, the key to be used for ids and byId.

Returns:

CollectionHoax - what is needed for a collection resource

Type
CollectionHoax

Type Definitions

CollectionHoax

Source:
Properties:
Name Type Description
Provider function

The collection context provider

useMember function

A react hook for

useCollection function

A react hook for

collectionHoax.Selectors
Field object
Type:
  • Object