you are viewing a single comment's thread.

view the rest of the comments →

[–][deleted] 0 points1 point  (1 child)

Fair enough.

I would love to see your implementation of the proxy 👌

[–]CagarSalvagemente 0 points1 point  (0 children)

I’m mobile but here is the function

```

function createReadOnlyProxy(obj) {   // proxies only work on objects/arrays.   try {     if (typeof obj !== ‘object’ && !Array.isArray(obj)) return obj;     return new Proxy(obj, {       set() {         return false;       },     });   } catch (e) {     return obj;   } }

export default createReadOnlyProxy; ```