new Connector(keyFunction, opt_type)
src/saij/connection/Connector.js, line 32
Create the Connector class with a function that will take two
module:saij/connection/Connection~Connectables 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}
src/saij/connection/Connector.js, line 65 -
Create a new connection between two connectables, using the keyFunction and type provided to generate a new connectionKey.
Name Type Description conAmodule:saij/connection/Connection~Connectable connection A
conBmodule:saij/connection/Connection~Connectable connection B
conA.getInputfunction conA.getOutputfunction conB.getInputfunction conB.getOutputfunction Returns:
new connection
Saij