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
You can improve SearchScreen by applying the following;
Do not pass the ViewModel object down to its children. Instead, extract the data you need from the ViewModel and pass those data along.
Make all other functions in SearchScreen private to prevent namespace pollution.
ObserveCurrentTime is quite misleading because it does more than just time observation. It also emits UI components.
You are exposing Mutable data types from your ViewModel to the public. Normally, you would want your ViewModel to only expose states to the UI. The sequence of UI->VM usually goes along these lines;
UI: Observes state from the VM
UI: Invokes a function from the VM
VM: Performs an operation
VM: Updates a state internally and publishes to subscribers
UI: Receives new state updates and refreshes components accordingly.
The text was updated successfully, but these errors were encountered:
rafsanjani
changed the title
Add preview for SearchScreen
Refactor SearchScreen
Feb 26, 2023
You can improve
SearchScreen
by applying the following;ViewModel
object down to its children. Instead, extract the data you need from theViewModel
and pass those data along.SearchScreen
private to prevent namespace pollution.ObserveCurrentTime
is quite misleading because it does more than just time observation. It also emits UI components.ViewModel
to the public. Normally, you would want your ViewModel to only expose states to the UI. The sequence of UI->VM usually goes along these lines;UI: Observes state from the VM
UI: Invokes a function from the VM
VM: Performs an operation
VM: Updates a state internally and publishes to subscribers
UI: Receives new state updates and refreshes components accordingly.
The text was updated successfully, but these errors were encountered: