This version (v0.7) has not been published to npm yet.
Skip to content

Reference / @getenginex/sdk-vue / useEnginexMutations

useEnginexMutations() ​

Call Signature ​

useEnginexMutations(): CoreMutations

Core mutation factories, created once per composable call (in setup). Each call (m.deposits.createPix()) returns the mutation options; use it inside the getter of useEnginexMutation.

With (factory, product) it returns the factories of a product package (see the other signature).

Returns ​

CoreMutations

The core mutation factories.

Throws ​

If called in an app without the EnginexPlugin.

Example ​

ts
const m = useEnginexMutations()
const pix = useEnginexMutation(() => m.deposits.createPix())

Call Signature ​

useEnginexMutations<P, M>(factory, product): M

Mutation factories of a product package (createIgamingMutations, createPredictionsMutations), created once per composable call.

Type Parameters ​

P ​

P

M ​

M

Parameters ​

factory ​

(product) => M

Product factory, e.g. createIgamingMutations.

product ​

P

The product object, e.g. the one returned by createIgaming(enginex).

Returns ​

M

The product mutation factories.

Throws ​

If called in an app without the EnginexPlugin.

Example ​

ts
const im = useEnginexMutations(createIgamingMutations, igaming)
const redeem = useEnginexMutation(() => im.loyalty.redeem())