Signal Factories and eslint warnings
I've created a factory for creating signals from a yjs document. Everything seems work ok, but the linter is giving warnings. Is the linter correct or is it a false positive due to the factory?
The last line gives the following lint warning:
The reactive variable 'provider' should be used within JSX, a tracked scope (like createEffect), or inside an event handler function, or else changes will be ignored.
2 Replies
Try to pass provider(), not the provider to metaSignal, if you want to read one time without watching for changes
Not sure how
from
works but often the liner gives false positives. The usage could be correct but it doesn't know how exactly you're using it and just warns that since you're assigning the a signal value to a variable, it might not be reactive
In this case, I think it should be good