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 hidding attributes feature #6

Open
nandi95 opened this issue Feb 13, 2021 · 0 comments
Open

Add hidding attributes feature #6

nandi95 opened this issue Feb 13, 2021 · 0 comments
Labels
enhancement New feature or request

Comments

@nandi95
Copy link
Collaborator

nandi95 commented Feb 13, 2021

Consider making attributes hidden or visible with methods.
This would be an options to temporarily "disable" access to attributes and relations. Meaning when one has hidden an attribute it will not return the value when using getAttribute.

This could also hide the attribute when looping over the model woth for...of (can be achieved by setting enumerable: false.

The proposed api would look like:

user.makeHidden(key).makeVisible(key);

Questions:

  • What should happen when one tries to use setAttributes
  • What should happen when sending data to the api (I imagine it should still be there)
@nandi95 nandi95 added the enhancement New feature or request label Feb 13, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

1 participant