docs: add warning for deep-charm and note for observe()

This commit is contained in:
littensy 2026-06-20 20:45:50 -07:00
parent d1fa2cce92
commit 02be296b3d
2 changed files with 62 additions and 0 deletions

View file

@ -885,6 +885,9 @@ You can opt-in to deep reactivity with the Deep Charm library:
### Installation
> [!WARNING]
> Deep Charm is an experimental library that is not fully documented, and the API is subject to breaking changes.
```sh
npm install @rbxts/deep-charm
yarn add @rbxts/deep-charm
@ -940,6 +943,22 @@ local proxy = reactive(raw)
print(toRaw(proxy) == raw) -- true
```
Calling `toRaw()` on a proxy also subscribes to its changes. This allows you to use proxies with `observe()` and other Charm APIs that accept a getter function:
```luau
local proxy, updateProxy = reactive({})
observe(function()
return toRaw(proxy)
end, function(value, key)
print(`Value {value} added at key {key}`)
end)
updateProxy(function(state)
table.insert(state, "foo")
end) -- Value foo added at key 1
```
---
### `isReactive(value)`