Open Fi1osof opened 7 months ago
Now editor.addConnection passed pure data:
context.editor.addConnection({ id: getUID(), source: source.nodeId, sourceOutput: source.key, target: target.nodeId, targetInput: target.key })
But we can use cusom Connection class, f.e.: https://github.com/Ni55aN/allmatter/blob/main/src/editor/connections/index.ts
import { ClassicPreset } from 'rete' import { Node } from '../types'; export class Connection<A extends Node, B extends Node> extends ClassicPreset.Connection<A, B> { }
https://github.com/Ni55aN/allmatter/blob/main/src/editor/import-export.ts#L81-L83
const conn = new Connection(source, c.sourceOutput, target, c.targetInput); await di.editor.addConnection(conn);
I want to have ability to provide connection class resolver (middleware) like this
render.addPreset(Presets.classic.setup({ customize: { control(data) { if (data.payload instanceof ColorPicker) return ColorPickerUI if (data.payload instanceof Preview) return PreviewUI return Presets.classic.InputControl as any }, } }));
Thanks!
https://github.com/retejs/rete/issues/633#issuecomment-1611264335
This issue is stale because it has been open 30 days with no activity. Remove stale label or comment or this will be closed in 10 days.
Now editor.addConnection passed pure data:
But we can use cusom Connection class, f.e.: https://github.com/Ni55aN/allmatter/blob/main/src/editor/connections/index.ts
https://github.com/Ni55aN/allmatter/blob/main/src/editor/import-export.ts#L81-L83
I want to have ability to provide connection class resolver (middleware) like this
Thanks!