@ctx-core/window 15.1.74 → 16.0.0

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.
@@ -1,8 +1,8 @@
1
- import type { be_computed_pair_T } from '@ctx-core/nanostores'
1
+ import type { be_memo_pair_T } from 'ctx-core/rmemo'
2
2
  export declare const [
3
3
  hostname$_,
4
4
  hostname_,
5
- ]:be_computed_pair_T<string>
5
+ ]:be_memo_pair_T<string>
6
6
  export {
7
7
  hostname$_ as hostname__,
8
8
  hostname$_ as window_location_hostname__,
package/hostname/index.js CHANGED
@@ -1,13 +1,13 @@
1
1
  /// <reference types="ctx-core" />
2
2
  /// <reference types="./index.d.ts" />
3
- import { be_computed_pair_ } from '@ctx-core/nanostores'
4
3
  import { nullish__none_ } from 'ctx-core/function'
4
+ import { be_memo_pair_ } from 'ctx-core/rmemo'
5
5
  import { window_location$_ } from '../window_location/index.js'
6
6
  /** @type {typeof hostname$_} */
7
7
  export const [
8
8
  hostname$_,
9
9
  hostname_,
10
- ] = be_computed_pair_(
10
+ ] = be_memo_pair_(
11
11
  ctx=>window_location$_(ctx),
12
12
  window_location=>nullish__none_([window_location], ()=>
13
13
  window_location.hostname),
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@ctx-core/window",
3
- "version": "15.1.74",
3
+ "version": "16.0.0",
4
4
  "description": "ctx-core window",
5
5
  "keywords": [
6
6
  "ctx-core",
@@ -31,9 +31,8 @@
31
31
  "./package.json": "./package.json"
32
32
  },
33
33
  "dependencies": {
34
- "@ctx-core/dom": "^15.1.68",
35
- "@ctx-core/nanostores": "^10.0.12",
36
- "ctx-core": "^5.4.1"
34
+ "@ctx-core/dom": "^15.1.69",
35
+ "ctx-core": "^5.5.0"
37
36
  },
38
37
  "devDependencies": {
39
38
  "c8": "^8.0.1",
@@ -1,8 +1,8 @@
1
- import type { be_computed_pair_T } from '@ctx-core/nanostores'
1
+ import type { be_memo_pair_T } from 'ctx-core/rmemo'
2
2
  export declare const [
3
3
  pathname$_,
4
4
  pathname_,
5
- ]:be_computed_pair_T<string>
5
+ ]:be_memo_pair_T<string>
6
6
  export {
7
7
  pathname$_ as pathname__,
8
8
  pathname$_ as b__pathname,
package/pathname/index.js CHANGED
@@ -1,17 +1,17 @@
1
1
  /// <reference types="ctx-core" />
2
2
  /// <reference types="./index.d.ts" />
3
- import { be_computed_pair_ } from '@ctx-core/nanostores'
4
3
  import { nullish__none_ } from 'ctx-core/function'
5
- import { window_location$_ } from '../window_location/index.js'
4
+ import { be_memo_pair_ } from 'ctx-core/rmemo'
5
+ import { window_location_ } from '../window_location/index.js'
6
6
  /** @typedef {Ctx} */
7
7
  /** @type {typeof pathname$_} */
8
8
  export const [
9
9
  pathname$_,
10
10
  pathname_,
11
- ] = be_computed_pair_(
12
- ctx=>window_location$_(ctx),
13
- window_location=>nullish__none_([window_location], ()=>
14
- window_location.pathname),
11
+ ] = be_memo_pair_(
12
+ ctx=>
13
+ nullish__none_([window_location_(ctx)], window_location=>
14
+ window_location.pathname),
15
15
  { id: 'pathname' })
16
16
  export {
17
17
  pathname$_ as pathname__,
@@ -1,8 +1,8 @@
1
- import type { be_computed_pair_T } from '@ctx-core/nanostores'
1
+ import type { be_memo_pair_T } from 'ctx-core/rmemo'
2
2
  import type { Ctx } from 'ctx-core/be'
3
3
  export declare const [
4
4
  window_location$_,
5
5
  window_location_,
6
- ]:be_computed_pair_T<Location>
6
+ ]:be_memo_pair_T<Location>
7
7
  export { window_location$_ as window_location__ }
8
8
  export declare function window_location__reset(ctx:Ctx):void
@@ -1,31 +1,29 @@
1
1
  /// <reference types="ctx-core" />
2
+ /// <reference types="./index.d.ts" />
2
3
  import { has_dom, no_dom } from '@ctx-core/dom'
3
- import { atom_, be_computed_pair_, computed_, onMount } from '@ctx-core/nanostores'
4
4
  import { be_ } from 'ctx-core/be'
5
- const window_location__atom$_ = be_(()=>
6
- atom_())
7
- /** @typedef {import('@ctx-core/nanostores').WritableAtom_} */
8
- /** @type {typeof import('./index.d.ts').window_location$_} */
5
+ import { be_memo_pair_, memo_, sig_ } from 'ctx-core/rmemo'
6
+ const window_location__sig$_ = be_(()=>
7
+ sig_())
8
+ /** @type {typeof window_location$_} */
9
9
  export const [
10
10
  window_location$_,
11
11
  window_location_,
12
- ] = /** @type {be_computed_pair_T<Location>} */ be_computed_pair_(be_(ctx=>{
13
- const window_location$ = computed_(window_location__atom$_(ctx),
14
- window_location__atom=>window_location__atom)
15
- if (has_dom) {
16
- let onpopstate = ()=>window_location__reset(ctx)
17
- onMount(window_location$, ()=>{
12
+ ] = /** @type {be_memo_pair_T<Location>} */ be_memo_pair_(be_(ctx=>
13
+ memo_(()=>
14
+ window_location__sig$_(ctx)(),
15
+ ()=>{
16
+ if (has_dom) {
17
+ let onpopstate = ()=>window_location__reset(ctx)
18
18
  window.addEventListener('popstate', onpopstate)
19
- return ()=>window.removeEventListener('popstate', onpopstate)
20
- })
21
- }
22
- return window_location$
23
- }, { id: 'window_location' }))
19
+ }
20
+ }),
21
+ { id: 'window_location' }))
24
22
  export { window_location$_ as window_location__ }
25
23
  /**
26
24
  * @param {Ctx}ctx
27
25
  */
28
26
  export function window_location__reset(ctx) {
29
27
  if (no_dom) return
30
- window_location__atom$_(ctx).$ = window.location
28
+ window_location__sig$_(ctx)._ = window.location
31
29
  }