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

Reference / @getenginex/sdk-vue / useEnginexQueries

useEnginexQueries() ​

Call Signature ​

useEnginexQueries(): CoreQueries

Core query factories, created once per composable call (in setup). Each call (q.wallet.getBalance()) returns the options with the user key as of the call; use it inside the getter of useEnginexQuery, which runs again when the session changes.

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

Returns ​

CoreQueries

The core query factories.

Throws ​

If called in an app without the EnginexPlugin.

Example ​

ts
const q = useEnginexQueries()
const balance = useEnginexQuery(() => q.wallet.getBalance(), { refetchInterval: 10_000 })

Call Signature ​

useEnginexQueries<P, Q>(factory, product): Q

Query factories of a product package (createIgamingQueries, createPredictionsQueries), created once per composable call. As in the core, call each factory inside the getter.

Type Parameters ​

P ​

P

Q ​

Q

Parameters ​

factory ​

(product) => Q

Product factory, e.g. createIgamingQueries.

product ​

P

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

Returns ​

Q

The product query factories.

Throws ​

If called in an app without the EnginexPlugin.

Example ​

ts
const ig = useEnginexQueries(createIgamingQueries, igaming)
const games = useEnginexQuery(() => ig.casino.listGames({ page: 1 }))