Module

React.Basic.Hooks.Suspense

Package
purescript-react-basic-hooks
Repository
spicydonuts/purescript-react-basic-hooks

#suspend Source

suspend :: forall a. Suspended a -> Pure a

Suspend rendering until a result exists.

Note: Error and loading states are thrown to React! Don't forget to implement a React error boundary and ensure suspend is only called from a child of at least one suspense parent!

Note: You probably shouldn't be using this function directly. It's primarily for library authors to build abstractions on top of, as it requires things like caching mechanisms external to the component tree.

Warning: React's Suspense API is still experimental. It requires some manual setup as well as specific versions of React. The API is also not final and these functions may change.

#Suspended Source

newtype Suspended a

Constructors

#SuspenseResult Source

#suspense Source

suspense :: { children :: Array JSX, fallback :: JSX } -> JSX