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