Skip to content
API/createQubee

createQubee

src/services/create-qubee.tsfunction
createQubee(config: QubeeConfig): Qubee

Wire up a store, a builder and a paginator for one driver.

The three share a store, which is what lets a parsed response teach the builder where it is:

import { createQubee, STRAPI_DRIVER } from '@qubeejs/core';
const { builder, paginator } = createQubee({ driver: STRAPI_DRIVER });
const uri = builder.setResource('articles').setLimit(25).generateUri();
const page = paginator.paginate(await fetch(uri).then((r) => r.json()));

Constructing the three by hand remains supported, and is what you want when they should not share state.

Parameter Type Description
config QubeeConfig The driver, plus optional request and response key overrides

Returns — The builder, paginator and the store they share