πŸ“„ File detail

ink/instances.ts

🧩 .tsπŸ“ 11 linesπŸ’Ύ 410 bytesπŸ“ text
← Back to All Files

🎯 Use case

This file lives under β€œink/”, which covers Ink terminal UI (layouts, TTY IO, keyboard, renderer components). It primarily provides a default export (component, class, or entry function). It composes internal code from ink (relative imports). What the file header says: Store all instances of Ink (instance.js) to ensure that consecutive render() calls use the same instance of Ink and don't create a new one This map has to be stored in a separate file, because render.js creates instances, but instance.js should delete itself from the map on unmou.

Generated from folder role, exports, dependency roots, and inline comments β€” not hand-reviewed for every path.

🧠 Inline summary

Store all instances of Ink (instance.js) to ensure that consecutive render() calls use the same instance of Ink and don't create a new one This map has to be stored in a separate file, because render.js creates instances, but instance.js should delete itself from the map on unmount

πŸ“€ Exports (heuristic)

  • default

πŸ–₯️ Source preview

// Store all instances of Ink (instance.js) to ensure that consecutive render() calls
// use the same instance of Ink and don't create a new one
//
// This map has to be stored in a separate file, because render.js creates instances,
// but instance.js should delete itself from the map on unmount

import type Ink from './ink.js'

const instances = new Map<NodeJS.WriteStream, Ink>()
export default instances