Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add "setters" and "methods" #21

Open
jonathanvanschenck opened this issue Jun 17, 2022 · 0 comments
Open

Add "setters" and "methods" #21

jonathanvanschenck opened this issue Jun 17, 2022 · 0 comments
Labels
enhancement New feature or request help wanted Extra attention is needed

Comments

@jonathanvanschenck
Copy link
Collaborator

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:

  1. .get's can be data, or a callback function taking no arguments (effectively a "getter")
  2. .set's can either directly set data, or trigger a callback function (effectively a "setter")
  3. We create a new operation .call or .compute or something which acts like the current .get function with parameters (effectively a class member function)
@jonathanvanschenck jonathanvanschenck added enhancement New feature or request help wanted Extra attention is needed labels Jun 17, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request help wanted Extra attention is needed
Development

No branches or pull requests

1 participant