instances.ts 410 B

12345678910
  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. import type Ink from './ink.js'
  7. const instances = new Map<NodeJS.WriteStream, Ink>()
  8. export default instances