From 309acce242674e911793fa58cb49f973e397b9d0 Mon Sep 17 00:00:00 2001 From: Matthew Huntington Date: Sat, 1 Feb 2025 18:39:23 -0500 Subject: [PATCH] basic state --- index.js | 15 +++++++++++++++ 1 file changed, 15 insertions(+) create mode 100644 index.js diff --git a/index.js b/index.js new file mode 100644 index 0000000..9141146 --- /dev/null +++ b/index.js @@ -0,0 +1,15 @@ +const state = new Proxy( + { + fun:true + }, + { + set: (target, prop, value) => { + console.log(`Property ${prop} changed from ${target[prop]} to ${value}`); + target[prop] = value + } + } +) + +console.log(state); +state.fun = false +console.log(state);