UNPKG

react-query

Version:

Hooks for managing, caching and syncing asynchronous and remote data in React

16 lines (11 loc) • 547 B
"use strict"; exports.__esModule = true; exports.shouldThrowError = shouldThrowError; function shouldThrowError(suspense, _useErrorBoundary, error) { // Allow useErrorBoundary function to override throwing behavior on a per-error basis if (typeof _useErrorBoundary === 'function') { return _useErrorBoundary(error); } // Allow useErrorBoundary to override suspense's throwing behavior if (typeof _useErrorBoundary === 'boolean') return _useErrorBoundary; // If suspense is enabled default to throwing errors return !!suspense; }