Skip to content

Commit

Permalink
Merge pull request #131 from TheCommieAxolotl/main
Browse files Browse the repository at this point in the history
Update answer to Proxy differences question in Q&A
  • Loading branch information
NullVoxPopuli authored Apr 3, 2024
2 parents ad62ec1 + 888c40c commit caa95f0
Showing 1 changed file with 6 additions and 1 deletion.
7 changes: 6 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -622,7 +622,12 @@ Note: untrack doesn't get you out of the `notifying` state, which is maintained
**Q**: What are Signals offering that `Proxy` doesn't currently handle?
**A**: Proxies must wrap some object. Proxies, by themselves, are not all that useful, but can't be used to create reactive-versions of Map, Set, Object, Array, etc. See Prior Implementations [tracked-built-ins](https://github.com/tracked-tools/tracked-built-ins/tree/master/addon/src/-private).
**A**: Proxies must wrap some object. They cannot be used to intercept property access/assignment to primitive values such as numbers, strings, or symbols.
See Prior Implementations [tracked-built-ins](https://github.com/tracked-tools/tracked-built-ins/tree/master/addon/src/-private), [discussion](https://github.com/proposal-signals/proposal-signals/issues/101#issuecomment-2029802574). The following is valid for a Signal, but not for a Proxy:
```js
new Proxy(0, { ... }) // TypeError: Cannot create proxy with a non-object as target or handler
new Signal.State(0); // Perfectly valid
```
#### How do Signals work?
Expand Down

0 comments on commit caa95f0

Please sign in to comment.