mirror of
https://github.com/projectstorm/react-diagrams.git
synced 2025-08-14 16:51:29 +08:00
15 lines
367 B
TypeScript
15 lines
367 B
TypeScript
import { PortModel, AbstractPortFactory } from "storm-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);
|
|
}
|
|
}
|