UNPKG

piral-core

Version:

The core library for creating a Piral instance.

8 lines 531 B
import * as React from 'react'; import { RegisteredErrorInfo, RegisteredLoadingIndicator } from './components'; import { useGlobalState } from '../hooks'; export const PiralSuspense = ({ children }) => { const { error, loading } = useGlobalState((m) => m.app); return error ? (React.createElement(RegisteredErrorInfo, { type: "loading", error: error })) : loading ? (React.createElement(RegisteredLoadingIndicator, null)) : (React.createElement(React.Fragment, null, children)); }; //# sourceMappingURL=PiralSuspense.js.map