@stackflow/plugin-history-sync
Advanced tools
Comparing version 1.3.11-alpha.6 to 1.3.11
@@ -1,2 +0,1 @@ | ||
export { useHistoryQueue } from "./HistoryQueueContext"; | ||
export * from "./historySyncPlugin"; | ||
@@ -3,0 +2,0 @@ export { makeTemplate, UrlPatternOptions } from "./makeTemplate"; |
@@ -53,3 +53,2 @@ "use strict"; | ||
normalizeRoute: () => normalizeRoute, | ||
useHistoryQueue: () => useHistoryQueue, | ||
useRoutes: () => useRoutes | ||
@@ -59,23 +58,2 @@ }); | ||
// src/HistoryQueueContext.tsx | ||
var import_react = require("react"); | ||
var import_jsx_runtime = require("react/jsx-runtime"); | ||
var HistoryQueueContext = (0, import_react.createContext)({ | ||
enqueue: () => { | ||
} | ||
}); | ||
var HistoryQueueProvider = ({ | ||
children, | ||
enqueue | ||
}) => { | ||
const ctx = (0, import_react.useMemo)( | ||
() => ({ | ||
enqueue | ||
}), | ||
[enqueue] | ||
); | ||
return /* @__PURE__ */ (0, import_jsx_runtime.jsx)(HistoryQueueContext.Provider, { value: ctx, children }); | ||
}; | ||
var useHistoryQueue = () => (0, import_react.useContext)(HistoryQueueContext); | ||
// src/historySyncPlugin.tsx | ||
@@ -230,13 +208,13 @@ var import_core = require("@stackflow/core"); | ||
// src/RoutesContext.tsx | ||
var import_react2 = require("react"); | ||
var import_jsx_runtime2 = require("react/jsx-runtime"); | ||
var RoutesContext = (0, import_react2.createContext)({}); | ||
var RoutesProvider = (props) => /* @__PURE__ */ (0, import_jsx_runtime2.jsx)(RoutesContext.Provider, { value: props.routes, children: props.children }); | ||
var import_react = require("react"); | ||
var import_jsx_runtime = require("react/jsx-runtime"); | ||
var RoutesContext = (0, import_react.createContext)({}); | ||
var RoutesProvider = (props) => /* @__PURE__ */ (0, import_jsx_runtime.jsx)(RoutesContext.Provider, { value: props.routes, children: props.children }); | ||
RoutesProvider.displayName = "RoutesProvider"; | ||
function useRoutes() { | ||
return (0, import_react2.useContext)(RoutesContext); | ||
return (0, import_react.useContext)(RoutesContext); | ||
} | ||
// src/historySyncPlugin.tsx | ||
var import_jsx_runtime3 = require("react/jsx-runtime"); | ||
var import_jsx_runtime2 = require("react/jsx-runtime"); | ||
var SECOND = 1e3; | ||
@@ -257,3 +235,3 @@ var MINUTE = 60 * SECOND; | ||
wrapStack({ stack }) { | ||
return /* @__PURE__ */ (0, import_jsx_runtime3.jsx)(HistoryQueueProvider, { enqueue, children: /* @__PURE__ */ (0, import_jsx_runtime3.jsx)(RoutesProvider, { routes: options.routes, children: stack.render() }) }); | ||
return /* @__PURE__ */ (0, import_jsx_runtime2.jsx)(RoutesProvider, { routes: options.routes, children: stack.render() }); | ||
}, | ||
@@ -260,0 +238,0 @@ overrideInitialEvents({ initialContext }) { |
@@ -6,3 +6,3 @@ import type { History } from "history"; | ||
export declare const makeHistoryTaskQueue: (history: History) => { | ||
enqueue: (action: () => void, listen?: boolean | undefined) => void; | ||
enqueue: (cb: () => void, listen?: boolean) => void; | ||
}; |
{ | ||
"name": "@stackflow/plugin-history-sync", | ||
"version": "1.3.11-alpha.6+7f18ac51", | ||
"version": "1.3.11", | ||
"license": "MIT", | ||
@@ -43,6 +43,6 @@ "exports": { | ||
"devDependencies": { | ||
"@stackflow/core": "^1.0.7", | ||
"@stackflow/core": "^1.0.8", | ||
"@stackflow/esbuild-config": "^1.0.0", | ||
"@stackflow/eslint-config": "^1.0.0", | ||
"@stackflow/react": "^1.1.4", | ||
"@stackflow/eslint-config": "^1.0.1", | ||
"@stackflow/react": "^1.1.5", | ||
"@swc/core": "^1.3.35", | ||
@@ -85,3 +85,3 @@ "@swc/jest": "^0.2.24", | ||
}, | ||
"gitHead": "7f18ac513e9826e4a9fafcdd46420cb356ec7f36" | ||
"gitHead": "75874e478057c53fa4d5ae82fb5dd64a7c43c603" | ||
} |
@@ -1,2 +0,1 @@ | ||
export { useHistoryQueue } from "./HistoryQueueContext"; | ||
export * from "./historySyncPlugin"; | ||
@@ -3,0 +2,0 @@ export { makeTemplate, UrlPatternOptions } from "./makeTemplate"; |
import type { History } from "history"; | ||
import type { HistoryQueueContextValue } from "HistoryQueueContext"; | ||
@@ -10,6 +9,3 @@ /** | ||
const enqueue: HistoryQueueContextValue["enqueue"] = ( | ||
cb: () => void, | ||
listen: boolean = true, | ||
) => { | ||
const enqueue = (cb: () => void, listen: boolean = true) => { | ||
previousTask = previousTask.then( | ||
@@ -16,0 +12,0 @@ () => |
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
No v1
QualityPackage is not semver >=1. This means it is not stable and does not support ^ ranges.
Found 1 instance in 1 package
1
160773
31
3072