Skip to content

@opencraft/providence


Interface: SingleModuleOptions\<T>

Defined in: singles/types/SingleModuleOptions.ts:7

The construction parameters are mostly state that the SingleModule will be initialized with. This contains both the data of both the singleton itself and meta information about its status and how it is to be managed.

Type Parameters

T

T

Properties

attempted?

optional attempted?: boolean

Defined in: singles/types/SingleModuleOptions.ts:32

Indicates whether we have attempted to fetch the data from its endpoint before. *


deleted?

optional deleted?: boolean

Defined in: singles/types/SingleModuleOptions.ts:40

Indicates that the resource this single is tracking has been deleted. *


endpoint?

optional endpoint?: string

Defined in: singles/types/SingleModuleOptions.ts:26

The URL for the endpoint this single tracks. You can set this to # if you're only using this single for local state management. This will prevent the patchers from making bogus network requests.


failed?

optional failed?: boolean

Defined in: singles/types/SingleModuleOptions.ts:38

Indicates that our attempt to fetch the data has failed. *


fetching?

optional fetching?: boolean

Defined in: singles/types/SingleModuleOptions.ts:34

Indicates whether we are currently waiting on the data to load from its endpoint. *


params?

optional params?: QueryParams | null

Defined in: singles/types/SingleModuleOptions.ts:42

The query string parameters used when performing network operations on the endpoint. *


persistent?

optional persistent?: boolean

Defined in: singles/types/SingleModuleOptions.ts:30

If set to true, the registry will not remove this module even if all listening components are removed.


ready?

optional ready?: boolean

Defined in: singles/types/SingleModuleOptions.ts:36

Indicates that we have fetched the component and x is now ready. *


x?

optional x?: T | null

Defined in: singles/types/SingleModuleOptions.ts:21

Initial value for x, which is the data structure the module is tracking.

Default: null