-
-
Notifications
You must be signed in to change notification settings - Fork 307
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
Warn users if no observables were found inside the builder function of Observer #110
Comments
Fixed with #111 |
I get this message: |
Can you share the |
That's the problem. How do I know which of my observers is observer@18? |
I would start by giving names to few Observer(name: 'test', builder: (_) {}); If you see the message with that name, you know you got your culprit. |
Ok thanks. I didn't know I could name my observers. That helped me in resolving the issue |
Great to know that. Perhaps you can make a blog post or send me a note on how you solved it and I can add it to the Guides section on mobx.pub :-) |
Will do that |
Hi, I'm experiencing same issue with this error "There are no observables detected in the builder function"
here is my widget
But everytime i run the code it always return me: I've tried changed use any solution? |
Few observations.
should not be an observable. change it to this:
Having said that if you had used
Then it should have also worked. And
And try again |
@Timbabs Just out of curiosity, I would like to know which between the @computed or the @observable is recommended for a simple getter. I mean, if I have a private observable variable like loading, is it better to just make it public and use the Observable widget, or let it remain public and use anyways the computed getter? |
@yaymalaga
or
Both work fine. So it's your choice. I will go for the later if concerned about class encapsulation. |
Class encapsulation is the motivation for #220. It feels awkward to have to do a private observable and a public computed for every property of a store you want to encapsulate. I'm not sure if that syntax is best but ideally the code generator could provide a better solution. |
Hi ! Reloaded application in 1.070ms. File client_page_dart: |
In your builder function, there is no
|
It's a good check to ensure no surprises. I just spent few mins to discover I had not marked the field as
@observable
. This check will ensure we get warned upfront.The text was updated successfully, but these errors were encountered: