Comment

Comment by effbott

This doesn't make the target object read-only - it just returns a reference to it.

  data = {one: "one"}
  ref = makeRef(data)
  ref().two = "two"
  
  data
  => Object {one: "one", two: "two"}
parent effbott 13 years ago

No comments yet

Be the first to share your thoughts.

Live from the official Hacker News API

A modern reader for Hacker News · SvelteKit + Skeleton