Skip to main content

Function: cached()

cached<C, M, I, ND>(transform?): (action) => Promise<null | ND>

Retrieve an instance from the cache. If the instance is not in cache or if the included relations are not loaded, returns null.

Type parameters​

• C extends object

• M extends Model

• I extends any

• ND = I

Parameters​

• transform?

Returns​

Function

Parameters​

• action: Action<C & ConsumeCache & ConsumeModel<M> & ConsumeInclude & ConsumeId, any>

Returns​

Promise<null | ND>

Source​

packages/core/src/actions/context/runners/cached.ts:30