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 computedFrom convenience functions #362

Open
mcmah309 opened this issue Dec 9, 2024 · 2 comments
Open

Add computedFrom convenience functions #362

mcmah309 opened this issue Dec 9, 2024 · 2 comments

Comments

@mcmah309
Copy link
Contributor

mcmah309 commented Dec 9, 2024

Tracking issue for: #360

An alternative representation to the current PR could be

(signal1, signal2, ...).computed((value1, value2, ...) => ...)

And add extension methods for each case

@mcmah309 mcmah309 changed the title Adds computedFrom convenience functions Add computedFrom convenience functions Dec 9, 2024
@rodydavis
Copy link
Owner

Could the generic be of type Record and only need to support 1?

@mcmah309
Copy link
Contributor Author

mcmah309 commented Dec 9, 2024

I'm not sure what you mean. Are you asking if this is possible?

(signal,).computed((value1) => ...);
// or
signal.computed((value1) => ...);

Then yes.

If you are asking if we only would need to implement one extension method that covers all cases, then no unfortunately. We would need one for each case. Probably best to implemented 5 to 10.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants