@@ -97,11 +97,11 @@ export const isAsync = (u: unknown): u is Async => Predicate.hasProperty(u, Asyn
|
||||
* Note: The component cannot have a prop named "promise" as it's reserved for internal use.
|
||||
*
|
||||
* @param self - The component to convert to an Async component
|
||||
* @returns A new Async component with the same body, error, and context types as the input
|
||||
* @returns A new `Async` component with the same body, error, and context types as the input
|
||||
*
|
||||
* @example
|
||||
* ```ts
|
||||
* const MyAsyncComponent = Component.make("MyComponent")(function*() { ... }).pipe(
|
||||
* const MyAsyncComponent = MyComponent.pipe(
|
||||
* Async.async,
|
||||
* )
|
||||
* ```
|
||||
@@ -141,18 +141,16 @@ export const async = <T extends Component.Component<any, any, any, any>>(
|
||||
* @example
|
||||
* ```ts
|
||||
* // Curried
|
||||
* const MyAsyncComponent = Component.make("MyComponent")(function*() { ... }).pipe(
|
||||
* const MyAsyncComponent = MyComponent.pipe(
|
||||
* Async.async,
|
||||
* Async.withOptions({ defaultFallback: <p>Loading...</p> }),
|
||||
* )
|
||||
*
|
||||
* // Uncurried
|
||||
* const MyAsyncComponent = Component.make("MyComponent")(function*() { ... }).pipe(
|
||||
* Async.async,
|
||||
* const MyAsyncComponent = Async.withOptions(
|
||||
* Async.async(MyComponent),
|
||||
* { defaultFallback: <p>Loading...</p> },
|
||||
* )
|
||||
* const MyAsyncComponentWithOptions = Async.withOptions(MyAsyncComponent, {
|
||||
* defaultFallback: <p>Loading...</p>,
|
||||
* })
|
||||
* ```
|
||||
*/
|
||||
export const withOptions: {
|
||||
|
||||
Reference in New Issue
Block a user