Skip to main content
Module

x/tui/mod.ts>makeMapMethodsReactive

🦕 Deno module for creating Terminal User Interfaces
Go to Latest
function makeMapMethodsReactive
Re-export
import { makeMapMethodsReactive } from "https://deno.land/x/tui@2.1.10/mod.ts";

Replaces set, delete and clear methods in given map with ones that provide reactivity.

When map gets in any way updated propagate method gets called on provided signal.

Type Parameters

T extends Map<unknown, unknown>
S

Parameters

map: T

Changes method of detecting value changes when .set() gets called.

  • When set to true it checks whether value changed.
  • When set to false it checks whether map size changed (default).
signal: Signal<S>
optional
watchMapUpdates = [UNSUPPORTED]