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
Derived keys #67
Comments
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
I have encountered a need where I would like to create a new key where the value is derived from one or more existing keys.
For example, let's say you have a
.name
and.email
key. You might want to simplify the checking and have a.hasFilledOutAllFields
key. This key would be derived from the former keys.The reason it has to be in
Defaults
and not just in a custom extension is that it needs to be reactive. So that, if either.name
or.email
changes,.hasFilledOutAllFields
triggers an update too.My initial thoughts are something like this:
Another use-case is needing the derived key to be settable too. Not sure how that would look like though.
And maybe it would be useful to be able to listen to external events too. For example, for the
.hasFilledOutAllFields
key, we might also need to ensure the keyboard is not shown or something.Maybe there's a more general way we could handle this. I'm open to ideas.
The text was updated successfully, but these errors were encountered: