Abstract
Method to run to send clients updates for a specific data type outside of the set<data_type>
method. papi overwrites this function on the DataProviderEngine itself to emit an update based on
the updateInstructions
and then run the original notifyUpdateMethod
from the
DataProviderEngine
.
@example To run notifyUpdate
function so it updates the Verse and Heresy data types (in a
data provider engine):
this.notifyUpdate(['Verse', 'Heresy']);
@example You can log the manual updates in your data provider engine by specifying the
following notifyUpdate
function in the data provider engine:
notifyUpdate(updateInstructions) {
papi.logger.info(updateInstructions);
}
Note: This function's return is treated the same as the return from set<data_type>
@param updateInstructions
Information that papi uses to interpret whether to send out
updates. Defaults to '*'
(meaning send updates for all data types) if parameter
updateInstructions
is not provided or is undefined. Otherwise returns updateInstructions
.
papi passes the interpreted update value into this notifyUpdate
function. For example, running
this.notifyUpdate()
will call the data provider engine's notifyUpdate
with
updateInstructions
of '*'
.
@see DataProviderUpdateInstructions for more info on the updateInstructions
parameter
WARNING: Do not update a data type in its get<data_type>
method (unless you make a base case)!
It will create a destructive infinite loop.
Optional
updateInstructions: DataProviderUpdateInstructions<TDataTypes>
Abstract class that provides a placeholder
notifyUpdate
for data provider engine classes. If a data provider engine class extends this class, it doesn't have to specify its ownnotifyUpdate
function in order to usenotifyUpdate
.See
IDataProviderEngine for more information on extending this class.