-
-
Notifications
You must be signed in to change notification settings - Fork 39
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
fresh() doesn't call any lifecycle Hook #1722
Comments
Actually, it can be useful, if you have one mutator that doesn't trigger the hooks. For example, if you need to save raw data from a backend. |
@harmyderoman I agree with you , But the issue is that in most cases we need to check the hooks ( as we're using May be we can add an optional |
Hmmm interesting. I try to get my thoughts around that. You both have valid points. |
Ran into this today - I wanted to use lifecycle hooks to normalise & process raw data from the backend into a predictable and useful format, so it was unexpected that certain insertion methods simply ignore all hooks. From this perspective, IMHO this behaviour feels like a gotcha, and almost even defeats the very purpose of hooks. I can definitely understand a use case for wanting to initiate the store with data without firing hooks - but this feels like something you should explicitly express during the action (such as the suggested In the interim, this note should be added to the documentation, because neither the |
Environment
No response
Reproduction
Playground
Describe the bug
I need to listen for the lifecycle hook inside the
Model
when thefresh()
is called , but no any lifecycle hook is listening tofresh()
while if i usesave()
it worksFor now i'm using this as a workaround
ideally
fresh()
should also be a lifecycle hook triggerAdditional context
No response
Logs
No response
The text was updated successfully, but these errors were encountered: