Add a disposing function callback to put(), lazyPut(), etc. #1292
OliverRhyme
started this conversation in
Ideas
Replies: 2 comments 1 reply
-
I don't think this feature is of any use, onClose already does exactly that job. |
Beta Was this translation helpful? Give feedback.
1 reply
-
or how can I implement this kind of behavior in getx? |
Beta Was this translation helpful? Give feedback.
0 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
Is your feature request related to a problem? Please describe.
I am not able to properly clear a getx dependency (I.E moor database) as the object requires a cleanup method to be called for it to be properly disposed.
Describe the solution you'd like
A disposing callback function that is called just before it is "deleted" by the getx. It should pass the current object to be deleted as the function parameter and should/can be an async function. Pretty much like get_it package disposing callbacks on thier register methods.
Describe alternatives you've considered
I've tried adding the GetLifecycleBase as a mixin to the class but it just makes the code "spaghetti" as all I want is to call a method on the object just before it is deleted by GetX.
Beta Was this translation helpful? Give feedback.
All reactions