Function: modelSnapshotOutWithMetadata()
function modelSnapshotOutWithMetadata<M>(modelClass, snapshot): SnapshotOutOfModel<M>;
Add missing model metadata to a model output snapshot to generate a proper model snapshot.
Usually used alongside applySnapshot.
Type Parameters
| Type Parameter | Description |
|---|---|
M extends AnyModel | Model type. |
Parameters
| Parameter | Type | Description |
|---|---|---|
modelClass | ModelClass<M> | Model class. |
snapshot | Omit<SnapshotOutOfModel<M>, typeof modelTypeKey> | Model output snapshot without metadata. |
Returns
The model snapshot (including metadata).