@typed/navigation 0.3.0 → 0.3.2
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/Navigation.d.ts +3 -4
- package/dist/Navigation.d.ts.map +1 -1
- package/dist/Navigation.js.map +1 -1
- package/dist/cjs/Navigation.d.ts +3 -4
- package/dist/cjs/Navigation.d.ts.map +1 -1
- package/dist/cjs/Navigation.js.map +1 -1
- package/dist/cjs/dom-intent.d.ts +4 -4
- package/dist/cjs/memory-intent.d.ts +4 -4
- package/dist/tsconfig.cjs.build.tsbuildinfo +1 -1
- package/package.json +9 -9
- package/src/Navigation.ts +5 -5
- package/tsconfig.build.tsbuildinfo +1 -1
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@typed/navigation",
|
|
3
|
-
"version": "0.3.
|
|
3
|
+
"version": "0.3.2",
|
|
4
4
|
"type": "module",
|
|
5
5
|
"main": "dist/index.js",
|
|
6
6
|
"module": "dist/index.js",
|
|
@@ -19,12 +19,12 @@
|
|
|
19
19
|
}
|
|
20
20
|
},
|
|
21
21
|
"dependencies": {
|
|
22
|
-
"@effect/data": "^0.
|
|
23
|
-
"@effect/io": "^0.
|
|
24
|
-
"@typed/context": "0.16.
|
|
25
|
-
"@typed/dom": "8.16.
|
|
26
|
-
"@typed/fx": "1.15.
|
|
27
|
-
"@typed/path": "0.5.
|
|
22
|
+
"@effect/data": "^0.17.0",
|
|
23
|
+
"@effect/io": "^0.36.1",
|
|
24
|
+
"@typed/context": "0.16.2",
|
|
25
|
+
"@typed/dom": "8.16.2",
|
|
26
|
+
"@typed/fx": "1.15.2",
|
|
27
|
+
"@typed/path": "0.5.2",
|
|
28
28
|
"happy-dom": "^10.5.2"
|
|
29
29
|
},
|
|
30
30
|
"publishConfig": {
|
|
@@ -32,8 +32,8 @@
|
|
|
32
32
|
},
|
|
33
33
|
"sideEffects": false,
|
|
34
34
|
"devDependencies": {
|
|
35
|
-
"@types/node": "^20.4.
|
|
35
|
+
"@types/node": "^20.4.5",
|
|
36
36
|
"vitest": "0.33.0"
|
|
37
37
|
},
|
|
38
|
-
"gitHead": "
|
|
38
|
+
"gitHead": "5565448a46ef863202b3e08a927da64ccb19c473"
|
|
39
39
|
}
|
package/src/Navigation.ts
CHANGED
|
@@ -1,6 +1,5 @@
|
|
|
1
1
|
import * as Brand from '@effect/data/Brand'
|
|
2
2
|
import { Option } from '@effect/data/Option'
|
|
3
|
-
import * as Cause from '@effect/io/Cause'
|
|
4
3
|
import * as Effect from '@effect/io/Effect'
|
|
5
4
|
import * as Scope from '@effect/io/Scope'
|
|
6
5
|
import * as Context from '@typed/context'
|
|
@@ -95,7 +94,7 @@ export const onNavigation = <R>(
|
|
|
95
94
|
handler: (event: NavigationEvent) => Effect.Effect<R, never, void>,
|
|
96
95
|
) => Navigation.withEffect((n) => n.onNavigation(handler))
|
|
97
96
|
|
|
98
|
-
export const canGoBack: Effect.Effect<Navigation,
|
|
97
|
+
export const canGoBack: Effect.Effect<Navigation, never, boolean> &
|
|
99
98
|
Fx.Fx<Navigation, never, boolean> = Object.assign(
|
|
100
99
|
Navigation.withEffect((n) => n.canGoBack),
|
|
101
100
|
Navigation.withFx((n) => n.canGoBack),
|
|
@@ -103,7 +102,7 @@ export const canGoBack: Effect.Effect<Navigation, Cause.NoSuchElementException,
|
|
|
103
102
|
|
|
104
103
|
export const back = Navigation.withEffect((n) => n.back)
|
|
105
104
|
|
|
106
|
-
export const canGoForward: Effect.Effect<Navigation,
|
|
105
|
+
export const canGoForward: Effect.Effect<Navigation, never, boolean> &
|
|
107
106
|
Fx.Fx<Navigation, never, boolean> = Object.assign(
|
|
108
107
|
Navigation.withEffect((n) => n.canGoForward),
|
|
109
108
|
Navigation.withFx((n) => n.canGoForward),
|
|
@@ -188,5 +187,6 @@ export interface OnNavigationOptions {
|
|
|
188
187
|
readonly passive?: boolean
|
|
189
188
|
}
|
|
190
189
|
|
|
191
|
-
export const getCurrentUrl: Effect.Effect<Navigation,
|
|
192
|
-
|
|
190
|
+
export const getCurrentUrl: Effect.Effect<Navigation, never, URL> = Navigation.withEffect((n) =>
|
|
191
|
+
n.currentEntry.map((d) => d.url),
|
|
192
|
+
)
|