ParentAPI

COMB~ ParentAPI

new ParentAPI(methods, properties)

Initialize a listening instance and set available methods.

Parameters:
Name Type Description
methods object

Functions that are available for the parent to call.

properties object

Properties to memorize in the instance for later use, optional

Properties:
Name Type Description
listener promise

Promise that is waiting for parent to connect

msg_bus object

Postmate instance

methods object

Method storage

properties object

Set properties storage

Source:
Example
const parent = new ParentAPI({
    "hello": async function () {
        return "Hello world";
    }
});
await parent.connect();

Methods

(async) connect() → {this}

Wait for parent to connect.

Source:
Example
const parent = new ParentAPI({
    "hello": async function () {
        return "Hello world";
    }
});
await parent.connect();