mirror of
https://github.com/projectstorm/react-diagrams.git
synced 2025-08-17 02:26:54 +08:00
15 lines
375 B
TypeScript
15 lines
375 B
TypeScript
import { PortModel, AbstractPortFactory } from '@projectstorm/react-diagrams';
|
|
|
|
export class SimplePortFactory extends AbstractPortFactory {
|
|
cb: (initialConfig?: any) => PortModel;
|
|
|
|
constructor(type: string, cb: (initialConfig?: any) => PortModel) {
|
|
super(type);
|
|
this.cb = cb;
|
|
}
|
|
|
|
getNewInstance(initialConfig?: any): PortModel {
|
|
return this.cb(initialConfig);
|
|
}
|
|
}
|