Skip to main content

Crono Boost

What Is this?

Crono Boost is a React component capable of handling multiple features with a single installation.

Its main purpose is to manage the interface of your application to the right GraphQL API installed in the Matchplat backend.

It uses Apollo Client 3.0 for GraphQL purposes:
Apollo Client

Use CronoBoost

Install CronoBoost in the highest possible component of your application:

import { CronoBoost } from "@matchplat/crono";

Use it for example as a wrapper for the component containing your App or Router:

const Wrapper = () => {
return (
<CronoBoost>
<MyApp />
</CronoBoost>
);
};

You can stop the silentRefresh by passing the prop refresh as false

const Wrapper = () => {
return (
<CronoBoost refresh={false}>
<MyApp />
</CronoBoost>
);
};

You can use uri to customize the uri to use for the database

const Wrapper = () => {
return (
<CronoBoost uri="yourUri">
<MyApp />
</CronoBoost>
);
};

default is true.

default is blank.

The component will take care of:

  • understand whether to use DEV API or PROD
  • install a link between Apollo Client and the API
  • manage the user's token
  • manage API calls with the user token
  • manage user token refresh
  • install a silent refresh into your app (you can turn this off as described)
  • manage app Responsive rem style
  • show Breakpoints for Responsive debug
  • manage a custom URI for GraphQl

For more information on which of these methods can be extracted individually, read Methods