Skip to main content

Function: one()

one<C, I, RawData, Data, Deserialized, Next>(transform?): (action) => Promise<null | Next>

Run the action and deserialize one model's instance. Returns null when not found or empty result.

Type parameters

C extends object

I extends never

RawData

Data

Deserialized extends DeserializedData <ModelInstance>

Next = I

Parameters

transform?

Returns

Function

Parameters

action: Action<C & ConsumeAdapter<RawData, Data> & ConsumeDeserializer<NonNullable<Data>, Deserialized>, any>

Returns

Promise<null | Next>

Source

packages/core/src/actions/context/runners/one.ts:31