Skip to content

storeUtils

fetchPaginatedData (async)

Fetches data from any Strapi API paginated endpoint.

Parameters:

  • endpoint: - The API endpoint to fetch data from.
  • queryParams: - Query parameters to pass to the API.
  • pageSize: - The number of records to fetch per page.

Returns:

  • The fetched data.

getEnvContext

Returns an object with the backend path, the current run date, the id of the current run, the header with the API token, the thisRunStore instance, and the guest fee. This is a convenience function to reuse the same often-used values across the app.

Returns:

  • An object with the backend path, the current run date, the id of the current run, the header with the API token, the thisRunStore instance, and the guest fee.

useSmartSyncManager

Creates a smart sync manager that will run a sync function at regular intervals. It will also run the sync function immediately when startSync is called. If the sync function is still running when the next interval is reached, it will not run again until the previous sync function has finished.

Parameters:

  • syncFn: - The function to run at each sync interval.
  • options: - The options object.
  • options.intervalMs: - The interval in milliseconds at which to run the sync function.
  • options.autoStart: - Whether to start the sync process automatically.

Returns:

doSync

Nested in: useSmartSyncManager

startSync

Nested in: useSmartSyncManager

stopSync

Nested in: useSmartSyncManager

Released under the MIT License.