I’ve compose hierarchy like below, que is NoteListComponent is querying db unnecessarily when I goto detail and come back (because of launchedEffect) is there any way I can ignore unwanted db queries ?
Use state hoisting to VM. Keep in state:
• notes List<>
• searchText String
• searchTextOfNotes String? // updates when notes loaded successfully
In searchNotes event check searchText on equality with searchTextOfNotes to avoid redundant requests.
Btw. with full state hoisting you don't need LaunchedEffect at all, just do logic inside VM's init block