@remix-run/router 1.5.0-pre.0 → 1.5.0-pre.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/dist/router.d.ts CHANGED
@@ -441,4 +441,5 @@ export declare function createStaticHandler(routes: AgnosticRouteObject[], opts?
441
441
  * provide an updated StaticHandlerContext suitable for a second SSR render
442
442
  */
443
443
  export declare function getStaticContextFromError(routes: AgnosticDataRouteObject[], context: StaticHandlerContext, error: any): StaticHandlerContext;
444
+ export declare function isDeferredData(value: any): value is DeferredData;
444
445
  export {};
package/dist/router.js CHANGED
@@ -1,5 +1,5 @@
1
1
  /**
2
- * @remix-run/router v1.5.0-pre.0
2
+ * @remix-run/router v1.5.0-pre.1
3
3
  *
4
4
  * Copyright (c) Remix Software Inc.
5
5
  *
@@ -3749,7 +3749,7 @@ async function callLoaderOrAction(type, request, match, matches, manifest, detec
3749
3749
  };
3750
3750
  }
3751
3751
 
3752
- if (result instanceof DeferredData) {
3752
+ if (isDeferredData(result)) {
3753
3753
  var _result$init, _result$init2;
3754
3754
 
3755
3755
  return {
@@ -4053,6 +4053,11 @@ function isRedirectResult(result) {
4053
4053
  return (result && result.type) === ResultType.redirect;
4054
4054
  }
4055
4055
 
4056
+ function isDeferredData(value) {
4057
+ let deferred = value;
4058
+ return deferred && typeof deferred === "object" && typeof deferred.data === "object" && typeof deferred.subscribe === "function" && typeof deferred.cancel === "function" && typeof deferred.resolveData === "function";
4059
+ }
4060
+
4056
4061
  function isResponse(value) {
4057
4062
  return value != null && typeof value.status === "number" && typeof value.statusText === "string" && typeof value.headers === "object" && typeof value.body !== "undefined";
4058
4063
  }
@@ -4173,5 +4178,5 @@ function getTargetMatch(matches, location) {
4173
4178
  return pathMatches[pathMatches.length - 1];
4174
4179
  } //#endregion
4175
4180
 
4176
- export { AbortedDeferredError, Action, ErrorResponse, IDLE_BLOCKER, IDLE_FETCHER, IDLE_NAVIGATION, UNSAFE_DEFERRED_SYMBOL, DeferredData as UNSAFE_DeferredData, convertRoutesToDataRoutes as UNSAFE_convertRoutesToDataRoutes, getPathContributingMatches as UNSAFE_getPathContributingMatches, invariant as UNSAFE_invariant, warning as UNSAFE_warning, createBrowserHistory, createHashHistory, createMemoryHistory, createPath, createRouter, createStaticHandler, defer, generatePath, getStaticContextFromError, getToPathname, isRouteErrorResponse, joinPaths, json, matchPath, matchRoutes, normalizePathname, parsePath, redirect, resolvePath, resolveTo, stripBasename };
4181
+ export { AbortedDeferredError, Action, ErrorResponse, IDLE_BLOCKER, IDLE_FETCHER, IDLE_NAVIGATION, UNSAFE_DEFERRED_SYMBOL, DeferredData as UNSAFE_DeferredData, convertRoutesToDataRoutes as UNSAFE_convertRoutesToDataRoutes, getPathContributingMatches as UNSAFE_getPathContributingMatches, invariant as UNSAFE_invariant, warning as UNSAFE_warning, createBrowserHistory, createHashHistory, createMemoryHistory, createPath, createRouter, createStaticHandler, defer, generatePath, getStaticContextFromError, getToPathname, isDeferredData, isRouteErrorResponse, joinPaths, json, matchPath, matchRoutes, normalizePathname, parsePath, redirect, resolvePath, resolveTo, stripBasename };
4177
4182
  //# sourceMappingURL=router.js.map