Build a MutateBackendMethods over a lazily-created mutation view.
checkRef is what every write method is gated on, so a write to an entity
the model does not hold is refused at the call site. It is a required
parameter rather than an optional one: a backend that forgot to pass it would
otherwise go back to accepting phantom writes with nothing to say it had.
getView is a thunk rather than a view because both backends create the
overlay on first write: it carries the on-demand property and quantity
extractors that give the overlay a base to merge against, and building it
for a session that never edits anything is wasted work.
undo / redo answer false. The mutation history they would walk belongs
to the viewer's store, and neither headless backend has one; a false return
is the documented "nothing to undo" answer, so callers read it correctly.
batchBegin / batchEnd are accepted and ignored for the same reason — they
group undo steps, and there are none. This matches the viewer adapter, whose
own batch methods are still a documented TODO.
Build a
MutateBackendMethodsover a lazily-created mutation view.checkRefis what every write method is gated on, so a write to an entity the model does not hold is refused at the call site. It is a required parameter rather than an optional one: a backend that forgot to pass it would otherwise go back to accepting phantom writes with nothing to say it had.getViewis a thunk rather than a view because both backends create the overlay on first write: it carries the on-demand property and quantity extractors that give the overlay a base to merge against, and building it for a session that never edits anything is wasted work.undo/redoanswerfalse. The mutation history they would walk belongs to the viewer's store, and neither headless backend has one; afalsereturn is the documented "nothing to undo" answer, so callers read it correctly.batchBegin/batchEndare accepted and ignored for the same reason — they group undo steps, and there are none. This matches the viewer adapter, whose own batch methods are still a documented TODO.