instances.ts
1 // Store all instances of Ink (instance.js) to ensure that consecutive render() calls 2 // use the same instance of Ink and don't create a new one 3 // 4 // This map has to be stored in a separate file, because render.js creates instances, 5 // but instance.js should delete itself from the map on unmount 6 7 import type Ink from './ink.js' 8 9 const instances = new Map<NodeJS.WriteStream, Ink>() 10 export default instances