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

Make computedFn Warnings Optional? #268

Open
destinmcmurry opened this issue Jul 22, 2020 · 2 comments
Open

Make computedFn Warnings Optional? #268

destinmcmurry opened this issue Jul 22, 2020 · 2 comments

Comments

@destinmcmurry
Copy link

Getting tons of the warning "invoking a computedFn from outside an reactive context won't be memoized, unless keepAlive is set" due to calling methods that use computedFns inside tests.

Ex: Test calls something like:

` handleSelection = (id) => {
        this.isSelected(id) ? this.deselect(id) : this.select(id);
 };`

to set up test case. And because isSelected is a computedFn, there's a warning for each time it's invoked. I see how these warnings are useful, but would it be possible to make them optional for cases like this?

@mweststrate
Copy link
Member

mweststrate commented Jul 22, 2020 via email

@urugator
Copy link
Contributor

urugator commented Dec 5, 2021

Should it respect requiresReaction or global computedRequiresReaction (meaning it wouldn't warn by default)?
Or maybe requiresReaction === false could be used as override - true or undefined would have no effect on the warning.

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

3 participants