Using the Proxy API for State Management
summary
Builds a Proxy-based state wrapper that intercepts get and set traps, uses Reflect to forward operations and WeakMap caches to avoid double-proxying, and recursively builds proxies for nested properties so path subscriptions work. Hooks into apollo with isomorphic fetch against a headless WordPress via wp graphql, sets the posts array on state and the tates library subscribers log 10 posts by title, proving the approach works end to end.
AI-written summary · about
chapters (5)
- 0:00Start
- 1:13About Myself
- 5:47Receiver
- 15:13Library for State Management
- 15:50Fetch Posts out of a Headless Wordpress Site
related talks
27mUnlock the Proxy Power (Vue.js)
26mJavaScript Metaprogramming - ES6 Proxy Use and Abuse
52mState management in a GraphQL era
52mJavaScript Metaprogramming - ES6 Proxy Use and Abuse
31mImmer, Immutability and the Wonderful World of Proxies
36mThe State Management Rollercoaster
29mBuilding a Time Machine with ES6 Proxies
07mJS Proxy, where have you been
