jonataslaw / getx

Open screens/snackbars/dialogs/bottomSheets without context, manage states and inject dependencies easily with Get.
MIT License
10.37k stars 1.63k forks source link

Computed properties #1198

Open subzero911 opened 3 years ago

subzero911 commented 3 years ago

Dear author, consider adding computed (as in MobX). These are getters which based upon observables (like String get fullname => firstName + lastName). When accessed, they recalculate its values only if underlying observable values are changed. It gives you a little performance optimization.

sheriffyusuf commented 3 years ago

GetX handles this, you can check the section of the state management docs which talks about maximum performance .This issue is being addressed there. Here is the link https://github.com/jonataslaw/getx/blob/master/documentation/en_US/state_management.md#simple-state-manager

subzero911 commented 3 years ago

GetX handles this, you can check the section of the state management docs which talks about maximum performance .This issue is being addressed there. Here is the link https://github.com/jonataslaw/getx/blob/master/documentation/en_US/state_management.md#simple-state-manager

It talks about GetBuilder (manual updating, like notifyListeners()), didn't find anything about computed properties.

sheriffyusuf commented 3 years ago

Here is the link to the section https://github.com/jonataslaw/getx/blob/master/documentation/en_US/state_management.md#maximum-performance

The link i provided prior to this one was not scrolling directly to the section you will have to do that yourself

subzero911 commented 3 years ago

Yes, I see, thanks a lot. I think I can close the issue, as this feature is implemented already.

subzero911 commented 2 years ago

@sheriffyusuf I just want to clarify. https://github.com/jonataslaw/getx/blob/master/documentation/en_US/state_management.md#maximum-performance The documentation said:

With GetX, if you join two variables, GetX() (similar to Observer() ) will only rebuild if it implies a real change of State.

Does it mean computed (two Rx variables joined by getter) works only with GetX<T>() and doesn't work with Obx() ?