Class Provider<P, C>

The transport used on the page where the iframe is embedded. Inherits the EventEmitter interface.

import {Provider} from 'magic-transport'

const id = 'UNIQ_ID'
const childOrigin = '*'
const sharedObject = {
hello: {
from: {
provider() {
return 'hello from provider'
}
}
}
}

const transport = new Provider({id, childOrigin, ...sharedObject})

transport.once('ready', () => {
// Transport is ready for use
})

Type Parameters

  • P

    The provider facade.

  • C

    The consumer facade.

Hierarchy (view full)

Constructors

Constructors

Generated using TypeDoc