Skip to main content
Module

x/tui/mod.ts>makeObjectReactiveToSignal

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

Makes {signal}'s value deeply reactive

When {watchObjectIndex} is set it is achieved using Proxy, otherwise:

  • In case of Array it overwrites push, pop, splice, sort and reverse on object and updates signal when they are called & array changed
  • In case of objects it overwrites all properties on object that are already present with getters and setters and updates signal when values change

Parameters

signal: Signal<T>
watchObjectIndex: boolean