You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Right now, sets only write over the data at an endpoint -- it would be really nice to have the ability to do "setters" so that a set might actually call an internal function which could take action before returning the result. This behavior can currently only be achieved with a parameter-requiring function via a .get, which is a pretty strange way of accomplishing this task.
While we are on the topic, it is also strange that .get functions can take arguments to begin with -- in an OOP-analogy the .get functions are half acting like a member-variable and half acting like a member-function. I propose we split this behavior out:
.get's can be data, or a callback function taking no arguments (effectively a "getter")
.set's can either directly set data, or trigger a callback function (effectively a "setter")
We create a new operation .call or .compute or something which acts like the current .get function with parameters (effectively a class member function)
The text was updated successfully, but these errors were encountered:
Right now, sets only write over the data at an endpoint -- it would be really nice to have the ability to do "setters" so that a set might actually call an internal function which could take action before returning the result. This behavior can currently only be achieved with a parameter-requiring function via a
.get
, which is a pretty strange way of accomplishing this task.While we are on the topic, it is also strange that
.get
functions can take arguments to begin with -- in an OOP-analogy the.get
functions are half acting like a member-variable and half acting like a member-function. I propose we split this behavior out:.get
's can be data, or a callback function taking no arguments (effectively a "getter").set
's can either directly set data, or trigger a callback function (effectively a "setter").call
or.compute
or something which acts like the current.get
function with parameters (effectively a class member function)The text was updated successfully, but these errors were encountered: