You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I am using Getx and its dependency injection mechanism.
sometime I am overthinking - should I inject a class that should remain in memory (for good as a Singelton) using
Get.put(SomeClass(), permanent: true)
or using
Get.put(SomeGetXService())
by reading the documentation, both ways seems to put the class in memory as Singelton, and it can only be deleted explicitly (i.e. not with Get.smartManagement).
as for me, I prefer not to extend the class with GetxService, since the first option is simpler to implement - but I feel like I might be missing something. having the class in memory as Singelton through out the app life-span is a must.
Thanks for your help
reacted with thumbs up emoji reacted with thumbs down emoji reacted with laugh emoji reacted with hooray emoji reacted with confused emoji reacted with heart emoji reacted with rocket emoji reacted with eyes emoji
Uh oh!
There was an error while loading. Please reload this page.
-
I am using Getx and its dependency injection mechanism.
sometime I am overthinking - should I inject a class that should remain in memory (for good as a Singelton) using
or using
by reading the documentation, both ways seems to put the class in memory as Singelton, and it can only be deleted explicitly (i.e. not with Get.smartManagement).
as for me, I prefer not to extend the class with GetxService, since the first option is simpler to implement - but I feel like I might be missing something. having the class in memory as Singelton through out the app life-span is a must.
Thanks for your help
Beta Was this translation helpful? Give feedback.
All reactions