XDMObjectRegistry class

Catalog of objects exposed for XDM

Methods

getInstance<T>(string, Object)

Get an instance of an object registered with the given id

register(string, Object | (contextData?: any) => Object)

Register an object (instance or factory method) exposed by this frame to callers in a remote frame

unregister(string)

Unregister an object (instance or factory method) that was previously registered by this frame

Method Details

getInstance<T>(string, Object)

Get an instance of an object registered with the given id

function getInstance<T>(instanceId: string, contextData?: Object): undefined | T

Parameters

instanceId

string

unique id of the registered object

contextData

Object

Optional context data to pass to a registered object's factory method

Returns

undefined | T

register(string, Object | (contextData?: any) => Object)

Register an object (instance or factory method) exposed by this frame to callers in a remote frame

function register(instanceId: string, instance: Object | (contextData?: any) => Object)

Parameters

instanceId

string

unique id of the registered object

instance

Object | (contextData?: any) => Object

Either: (1) an object instance, or (2) a function that takes optional context data and returns an object instance.

unregister(string)

Unregister an object (instance or factory method) that was previously registered by this frame

function unregister(instanceId: string)

Parameters

instanceId

string

unique id of the registered object