Skip to content

Latest commit

 

History

History
12 lines (10 loc) · 435 Bytes

should-update.md

File metadata and controls

12 lines (10 loc) · 435 Bytes

ShouldUpdate

  • When the state changes, the store flatly notifies all the components.
  • By default, the framework uses identical to compare the old and new state to determine if a refresh is needed.
  • If we have a very precise request for component refresh, then we can define a ShouldUpdate ourselves.
  • Sample Code
bool shouldUpdate(DetailState old, DetailState now) {
    return old.message != now.message;
}