Function: req()
function req<Req>(): ReqMarker<Req>;
Creates a typed requirement marker for defineModelMixin.
Type Parameters
| Type Parameter | Description |
|---|---|
Req extends object | Shape that must exist on the base model instance. |
Returns
ReqMarker<Req>
Example
const producerMixin = defineModelMixin(
{ produced: tProp(types.number, 0) },
req<{ quantity: number }>()
)