projectDataProviderSource
String name of the id of the project
to get OR projectDataProvider (result of useProjectDataProvider
if you want to consolidate
and only get the Project Data Provider once). If you provide a project id, this hook will use a
PDP for this project that supports the platform.base
projectInterface
.
Note: If you provide a projectDataProvider directly, it must be an IBaseProjectDataProvider
The string id of the project setting to interact with
WARNING: MUST BE STABLE - const or wrapped in useState, useMemo, etc. The reference must not be updated every render
The initial value to return while first awaiting the project setting value
Optional
subscriberOptions: DataProviderSubscriberOptionsVarious options to adjust how the subscriber emits updates
Note: this parameter is internally assigned to a ref
, so changing it will not cause any hooks
to re-run with its new value. This means that subscriberOptions
will be passed to the data
provider's subscribe<data_type>
method as soon as possible and will not be updated again
until dataProviderSource
or selector
changes.
[setting, setSetting, resetSetting]
setting
: the current value for the project setting from the Project Data Provider with the
specified key, either the defaultValue
or the resolved setting valuesetSetting
: asynchronous function to request that the Project Data Provider update the project
setting with the specified key. Returns true
if successful. Note that this function does
not update the data. The Project Data Provider sends out an update to this subscription if
it successfully updates data.resetSetting
: asynchronous function to request that the Project Data Provider reset the project
settingisLoading
: whether the setting value is awaiting retrieval from the Project Data Provider
Gets, sets and resets a project setting on the papi for a specified project. Also notifies subscribers when the project setting changes and gets updated when the project setting is changed by others.
Throws
When subscription callback function is called with an update that has an unexpected message type