mirror of
https://github.com/projectstorm/react-diagrams.git
synced 2025-08-15 09:19:05 +08:00
15 lines
361 B
TypeScript
15 lines
361 B
TypeScript
import { PortModel, AbstractPortFactory } from "../../src/main";
|
|
|
|
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);
|
|
}
|
|
}
|