Allows overriding a platform's default setWindowContext behavior. All calls to Platform.setWindowContext will pass through the override.
Example
const overrideCallback = (PlatformProvider) => {
class Override extends PlatformProvider {
async setWindowContext(payload, callerIdentity) {
// Perhaps in our platform, we wish to only take context updates from windows
// and ignore updates sent from views.
if (payload.entityType === 'view') {
throw new Error('Updating window context from a view is not permitted in this platform.');
}
return super.setWindowContext(payload, callerIdentity);
}
}
return new Override();
}
fin.Platform.init({ overrideCallback });