Create the Connector class with a function that will take two
module:saij/connection/Connection~Connectable
s and create a
key from them.
const keyFunction = (conA, conB)=> `${conA.getName()}:${conB.getName()}`
const connector = new Connector(keyFunction, 'simplex');
const connection = connector.connect(conA, conB);
Name | Type | Description |
---|---|---|
keyFunction |
module:saij/connection/Connector~ConnectionKeyFunction |
key string creating function |
type |
module:saij/connection/ConnectionType |
optional connection type |
Methods
-
connect(conA, conB){module:saij/connection/Connection~Connection}
-
Create a new connection between two connectables, using the keyFunction and type provided to generate a new connectionKey.
Name Type Description conA
module:saij/connection/Connection~Connectable connection A
conB
module:saij/connection/Connection~Connectable connection B
conA.getInput
function conA.getOutput
function conB.getInput
function conB.getOutput
function Returns:
new connection