@colisweb/rescript-toolkit 5.28.0 → 5.29.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/package.json
CHANGED
package/src/request/Request.res
CHANGED
|
@@ -295,9 +295,10 @@ module FetchAndRender = {
|
|
|
295
295
|
and type error = err
|
|
296
296
|
),
|
|
297
297
|
~argument,
|
|
298
|
+
~options=?,
|
|
298
299
|
~children,
|
|
299
300
|
) => {
|
|
300
|
-
let (data, _, _) = useFetcher(config, Some(argument))
|
|
301
|
+
let (data, _, _) = useFetcher(~options?, config, Some(argument))
|
|
301
302
|
|
|
302
303
|
children(data)
|
|
303
304
|
}
|
|
@@ -315,6 +316,7 @@ module FetchAndRenderWithSuspense = {
|
|
|
315
316
|
~argument,
|
|
316
317
|
~children,
|
|
317
318
|
~fallback=?,
|
|
319
|
+
~options=?,
|
|
318
320
|
~fallbackRender,
|
|
319
321
|
) => {
|
|
320
322
|
<Toolkit.Ui.ErrorBoundary
|
|
@@ -324,7 +326,7 @@ module FetchAndRenderWithSuspense = {
|
|
|
324
326
|
fallbackRender(apiError)
|
|
325
327
|
}}>
|
|
326
328
|
<React.Suspense fallback={fallback->Option.getWithDefault(<Toolkit.Ui.SpinnerFullScreen />)}>
|
|
327
|
-
<FetchAndRender config argument> {data => children(data)} </FetchAndRender>
|
|
329
|
+
<FetchAndRender ?options config argument> {data => children(data)} </FetchAndRender>
|
|
328
330
|
</React.Suspense>
|
|
329
331
|
</Toolkit.Ui.ErrorBoundary>
|
|
330
332
|
}
|
|
@@ -179,6 +179,14 @@ module Make = (Config: RouterConfig) => {
|
|
|
179
179
|
}, [])
|
|
180
180
|
}
|
|
181
181
|
|
|
182
|
+
module Use = {
|
|
183
|
+
@react.component
|
|
184
|
+
let make = (~routes: array<link>) => {
|
|
185
|
+
use(routes)
|
|
186
|
+
React.null
|
|
187
|
+
}
|
|
188
|
+
}
|
|
189
|
+
|
|
182
190
|
@react.component
|
|
183
191
|
let make = () => {
|
|
184
192
|
let {links} = store.useStore()
|