Interface: SingleModuleOptions<T>
singles/types/SingleModuleOptions.SingleModuleOptions
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
Name |
---|
T |
Properties
attempted
• Optional
attempted: boolean
Indicates whether we have attempted to fetch the data from its endpoint before. *
Defined in
src/base/singles/types/SingleModuleOptions.ts:32
deleted
• Optional
deleted: boolean
Indicates that the resource this single is tracking has been deleted. *
Defined in
src/base/singles/types/SingleModuleOptions.ts:40
endpoint
• Optional
endpoint: string
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.
Defined in
src/base/singles/types/SingleModuleOptions.ts:26
failed
• Optional
failed: boolean
Indicates that our attempt to fetch the data has failed. *
Defined in
src/base/singles/types/SingleModuleOptions.ts:38
fetching
• Optional
fetching: boolean
Indicates whether we are currently waiting on the data to load from its endpoint. *
Defined in
src/base/singles/types/SingleModuleOptions.ts:34
name
• Private
name: string
The name of the module. Don't specify this-- it will be automatically supplied internally elsewhere.
Defined in
src/base/singles/types/SingleModuleOptions.ts:13
params
• Optional
params: null
| QueryParams
The query string parameters used when performing network operations on the endpoint. *
Defined in
src/base/singles/types/SingleModuleOptions.ts:42
persistent
• Optional
persistent: boolean
If set to true, the registry will not remove this module even if all listening components are removed.
Defined in
src/base/singles/types/SingleModuleOptions.ts:30
ready
• Optional
ready: boolean
Indicates that we have fetched the component and x is now ready. *
Defined in
src/base/singles/types/SingleModuleOptions.ts:36
x
• Optional
x: null
| T
Initial value for x, which is the data structure the module is tracking.
Default: null