__definesetter__
is a private function from fs-extra
that allows defining custom setters on an object. Here is an example of how to use it:
index.tsx322 chars20 lines
In this example, we define an object with a private _value
property and a getter and a setter for the value
property. We then use the __definesetter__
function to define a custom setter that logs the new value to the console. When we set the value
property to a new value, the custom setter gets called and logs the new value.
gistlibby LogSnag