luisherranz / deepsignal

DeepSignal 🧶 - Preact signals, but using regular JavaScript objects

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Support Maps.

aspizu opened this issue · comments

Cannot proxy a Map.
I get,

Uncaught Error: This object can't be observed.

I don't have plans to support Map or Set at this moment, but I invite you to create your own SignalMap/SignalSet library, and use it inside of other deep signals if you want:

import { SignalMap } from "your-signalmap-library";
import { deepSignal } from "deepsignal";

const state = deepSignal({
  someProp: "...",
  someMap: new SignalMap(),
});