Skip to main content

Function: save()

save<C, D, I, Record, Related, Data>(instance): (action) => Action<C & ConsumeModel <Model<D, I>> & ConsumeInstance<I> & ConsumeId>

Prepare context for an instance creation or update depending on its existence state. Calls "update" if the instance exists, otherwise call "create".

Type parameters

C extends object

D extends object

I extends ModelInstance<D>

Record

Related

Data

Parameters

instance: ModelClassInstance<D> & I

Returns

Function

Parameters

action: Action<C & ConsumeSerializer<Record, Related, Data>>

Returns

Action<C & ConsumeModel <Model<D, I>> & ConsumeInstance<I> & ConsumeId>

Source

packages/core/src/actions/context/enhancers/crud/save.ts:39