You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
In version 1.1 both functions has been deprecated:
client.event.listen(pattern, function(eventName, isSubscribed) {})
and client.record.listen(pattern, function(match, isSubscribed){})
To do it the proper way you need to pass a third argument to the callback which provides two functions: accept and reject. One of them needs to be called within the callback.
listen(pattern,function(name,isSubscribed,response){if(isSubscribed){response.accept()// if you want to provide the event name / record name// otherwise call response.reject()}else{// stop providing the event name / record name}})
For records the subscriber can check a boolean flag via aRecord.hasProvider or register a handler for the hasProviderChanged event for the same boolean flag.
This could change the behaviour of your app since the feature was a bit broken before.
To avoid breaking changes we decided to keep the old behaviour and add a deprecated message instead.
In version 1.1 both functions has been deprecated:
client.event.listen(pattern, function(eventName, isSubscribed) {})
and
client.record.listen(pattern, function(match, isSubscribed){})
To do it the proper way you need to pass a third argument to the callback which provides two functions:
accept
andreject
. One of them needs to be called within the callback.For records the subscriber can check a boolean flag via
aRecord.hasProvider
or register a handler for thehasProviderChanged
event for the same boolean flag.For more details checkout the documentation
The text was updated successfully, but these errors were encountered: