()
| 36 | * @example |
| 37 | */ |
| 38 | export function createPortsStore(): PortsStore { |
| 39 | const portElements = createPortsData(); |
| 40 | const portEvents = subscribeHandler(); |
| 41 | return { |
| 42 | subscribe: portEvents.subscribe, |
| 43 | getPortElement(cellId, portId) { |
| 44 | const portElement = portElements.get(cellId, portId); |
| 45 | if (!portElement) { |
| 46 | return; |
| 47 | } |
| 48 | return portElement; |
| 49 | }, |
| 50 | onRenderPorts(cellId, portElementsCache) { |
| 51 | portElements.set(cellId, portElementsCache); |
| 52 | portEvents.notifySubscribers(); |
| 53 | }, |
| 54 | destroy() { |
| 55 | portElements.clear(); |
| 56 | }, |
| 57 | }; |
| 58 | } |
no test coverage detected