Skip to content

💡 Make update more fine grained about what to update #49

Open
@pjechris

Description

@pjechris

Summary

Today when update closure is called the whole value is updated even if:

  • not all its relationships changed
  • maybe even nothing changed at all

Idea would be to:

  • do nothing when nothing changed (no update or update applied the same value)
  • only update what changed (if a nested entity did not change: do not update it)

Basic Example

// BEFORE: triggers an update on A and all its children
// AFTER: triggers nothing
identityMap.store(A.self, id: a.id) { _ in
}


// BEFORE: triggers an update on A, B and C
// AFTER: triggers an update on A and C (B did not change)
identityMap.store(A.self, id: a.id) {
  $0.b = $0.b
  $0.c = newValue
}

Unresolved questions

No response

Metadata

Metadata

Assignees

No one assigned

    Labels

    featureNew feature or request

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions