@isograph/react-disposable-state 0.0.0-main-82400fb8 → 0.0.0-main-627be459
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/.turbo/turbo-compile-libs.log +1 -1
- package/dist/CacheItem.d.ts +1 -1
- package/dist/CacheItem.d.ts.map +1 -1
- package/dist/ParentCache.d.ts +2 -2
- package/dist/ParentCache.d.ts.map +1 -1
- package/dist/useCachedResponsivePrecommitValue.d.ts +2 -2
- package/dist/useCachedResponsivePrecommitValue.d.ts.map +1 -1
- package/dist/useDisposableState.d.ts +3 -3
- package/dist/useDisposableState.d.ts.map +1 -1
- package/dist/useHasCommittedRef.d.ts +1 -1
- package/dist/useHasCommittedRef.d.ts.map +1 -1
- package/dist/useLazyDisposableState.d.ts +1 -1
- package/dist/useLazyDisposableState.d.ts.map +1 -1
- package/dist/useUpdatableDisposableState.d.ts +1 -1
- package/dist/useUpdatableDisposableState.d.ts.map +1 -1
- package/package.json +2 -2
- package/src/CacheItem.test.ts +3 -6
- package/src/CacheItem.ts +1 -1
- package/src/ParentCache.test.ts +2 -2
- package/src/ParentCache.ts +3 -2
- package/src/useCachedResponsivePrecommitValue.test.tsx +2 -2
- package/src/useCachedResponsivePrecommitValue.ts +2 -2
- package/src/useDisposableState.ts +3 -3
- package/src/useHasCommittedRef.ts +1 -1
- package/src/useLazyDisposableState.test.tsx +1 -1
- package/src/useLazyDisposableState.ts +1 -1
- package/src/useUpdatableDisposableState.ts +1 -1
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
../.. | WARN Unsupported engine: wanted: {"node":"22.9.0"} (current: {"node":"v22.21.1","pnpm":"10.15.0"})
|
|
2
2
|
|
|
3
|
-
> @isograph/react-disposable-state@0.0.0-main-
|
|
3
|
+
> @isograph/react-disposable-state@0.0.0-main-627be459 compile-libs /home/runner/work/isograph/isograph/libs/isograph-react-disposable-state
|
|
4
4
|
> rimraf dist && tsc -p tsconfig.pkg.json
|
|
5
5
|
|
package/dist/CacheItem.d.ts
CHANGED
package/dist/CacheItem.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"CacheItem.d.ts","sourceRoot":"","sources":["../src/CacheItem.ts"],"names":[],"mappings":"AAAA,OAAO,
|
|
1
|
+
{"version":3,"file":"CacheItem.d.ts","sourceRoot":"","sources":["../src/CacheItem.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EACV,SAAS,EACT,OAAO,EACP,eAAe,EAChB,MAAM,4BAA4B,CAAC;AAIpC,MAAM,MAAM,2BAA2B,GAAG;IACxC,IAAI,EAAE,6BAA6B,CAAC;CACrC,CAAC;AACF,MAAM,MAAM,8BAA8B,CAAC,CAAC,IAAI;IAC9C,IAAI,EAAE,gCAAgC,CAAC;IACvC,KAAK,EAAE,CAAC,CAAC;IACT,YAAY,EAAE,MAAM,IAAI,CAAC;IAGzB,oBAAoB,EAAE,MAAM,CAAC;CAC9B,CAAC;AACF,MAAM,MAAM,2BAA2B,CAAC,CAAC,IAAI;IAC3C,IAAI,EAAE,6BAA6B,CAAC;IACpC,KAAK,EAAE,CAAC,CAAC;IACT,YAAY,EAAE,MAAM,IAAI,CAAC;IACzB,qBAAqB,EAAE,MAAM,IAAI,CAAC;IAGlC,oBAAoB,EAAE,MAAM,CAAC;IAG7B,oBAAoB,EAAE,MAAM,CAAC;CAC9B,CAAC;AAEF,MAAM,MAAM,cAAc,CAAC,CAAC,IACxB,2BAA2B,CAAC,CAAC,CAAC,GAC9B,8BAA8B,CAAC,CAAC,CAAC,GACjC,2BAA2B,CAAC;AAEhC,MAAM,MAAM,gBAAgB,GAAG;IAC7B,mBAAmB,EAAE,MAAM,CAAC;CAC7B,CAAC;AAKF;;;;;;;;;;;;;;;;;;;;;;;GAuBG;AACH,qBAAa,SAAS,CAAC,CAAC;IACtB,OAAO,CAAC,OAAO,CAAoB;IACnC,OAAO,CAAC,SAAS,CAA0B;gBAQzC,OAAO,EAAE,OAAO,CAAC,CAAC,CAAC,EACnB,qBAAqB,EAAE,SAAS,EAChC,OAAO,EAAE,gBAAgB,GAAG,IAAI;IAgBlC,QAAQ,IAAI,CAAC;IAiBb,4BAA4B,CAC1B,wBAAwB,EAAE,SAAS,GAClC,eAAe,CAAC,CAAC,CAAC,GAAG,IAAI;IA8E5B,eAAe,IAAI,SAAS;IAkE5B,eAAe,IAAI,SAAS;IAoE5B,OAAO,CAAC,2CAA2C;IAoBnD,OAAO,CAAC,8CAA8C;CAUvD;AAED,wBAAgB,kCAAkC,CAAC,CAAC,EAClD,OAAO,EAAE,OAAO,CAAC,CAAC,CAAC,EACnB,qBAAqB,EAAE,SAAS,EAChC,OAAO,EAAE,gBAAgB,GAAG,IAAI,GAC/B,CAAC,SAAS,CAAC,CAAC,CAAC,EAAE,SAAS,CAAC,CAI3B"}
|
package/dist/ParentCache.d.ts
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { CleanupFn, Factory, ItemCleanupPair } from '@isograph/disposable-types';
|
|
2
|
-
import { CacheItem } from './CacheItem';
|
|
1
|
+
import type { CleanupFn, Factory, ItemCleanupPair } from '@isograph/disposable-types';
|
|
2
|
+
import type { CacheItem } from './CacheItem';
|
|
3
3
|
/**
|
|
4
4
|
* ParentCache
|
|
5
5
|
* - A ParentCache can be in two states: populated and unpopulated.
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ParentCache.d.ts","sourceRoot":"","sources":["../src/ParentCache.ts"],"names":[],"mappings":"AAAA,OAAO,
|
|
1
|
+
{"version":3,"file":"ParentCache.d.ts","sourceRoot":"","sources":["../src/ParentCache.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EACV,SAAS,EACT,OAAO,EACP,eAAe,EAChB,MAAM,4BAA4B,CAAC;AACpC,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,aAAa,CAAC;AAM7C;;;;;;;;;;;;;;;GAeG;AACH,qBAAa,WAAW,CAAC,CAAC;IACxB,OAAO,CAAC,WAAW,CAA6B;IAChD,OAAO,CAAC,QAAQ,CAAC,SAAS,CAAa;gBAI3B,OAAO,EAAE,OAAO,CAAC,CAAC,CAAC;IAI/B;;;;;;;;;OASG;IACH,8BAA8B,IAAI,eAAe,CAAC,CAAC,CAAC,GAAG,IAAI;IAM3D,+BAA+B,IAAI,CAAC,SAAS,CAAC,CAAC,CAAC,EAAE,CAAC,EAAE,SAAS,CAAC;IAM/D,OAAO,CAAC,4BAA4B;IA4BpC,KAAK;IAIL,IAAI,OAAO,IAAI,OAAO,CAAC,CAAC,CAAC,CAExB;IAED,OAAO,IAAI,OAAO;CAGnB"}
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { ItemCleanupPair } from '@isograph/disposable-types';
|
|
2
|
-
import { ParentCache } from './ParentCache';
|
|
1
|
+
import type { ItemCleanupPair } from '@isograph/disposable-types';
|
|
2
|
+
import type { ParentCache } from './ParentCache';
|
|
3
3
|
/**
|
|
4
4
|
* useCachedResponsivePrecommitValue<T>
|
|
5
5
|
* - Takes a mutable parent cache, a factory function, and an onCommit callback.
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"useCachedResponsivePrecommitValue.d.ts","sourceRoot":"","sources":["../src/useCachedResponsivePrecommitValue.ts"],"names":[],"mappings":"AAEA,OAAO,EAAE,eAAe,EAAE,MAAM,4BAA4B,CAAC;
|
|
1
|
+
{"version":3,"file":"useCachedResponsivePrecommitValue.d.ts","sourceRoot":"","sources":["../src/useCachedResponsivePrecommitValue.ts"],"names":[],"mappings":"AAEA,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,4BAA4B,CAAC;AAElE,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,eAAe,CAAC;AAEjD;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GA+BG;AACH,wBAAgB,iCAAiC,CAAC,CAAC,EACjD,WAAW,EAAE,WAAW,CAAC,CAAC,CAAC,EAC3B,QAAQ,EAAE,CAAC,IAAI,EAAE,eAAe,CAAC,CAAC,CAAC,KAAK,IAAI,GAC3C;IAAE,KAAK,EAAE,CAAC,CAAA;CAAE,GAAG,IAAI,CA8DrB"}
|
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import { ItemCleanupPair } from '@isograph/disposable-types';
|
|
2
|
-
import { ParentCache } from './ParentCache';
|
|
3
|
-
import { UnassignedState } from './useUpdatableDisposableState';
|
|
1
|
+
import type { ItemCleanupPair } from '@isograph/disposable-types';
|
|
2
|
+
import type { ParentCache } from './ParentCache';
|
|
3
|
+
import { type UnassignedState } from './useUpdatableDisposableState';
|
|
4
4
|
type UseUpdatableDisposableStateReturnValue<T> = {
|
|
5
5
|
state: T;
|
|
6
6
|
setState: (pair: ItemCleanupPair<Exclude<T, UnassignedState>>) => void;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"useDisposableState.d.ts","sourceRoot":"","sources":["../src/useDisposableState.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,eAAe,EAAE,MAAM,4BAA4B,CAAC;
|
|
1
|
+
{"version":3,"file":"useDisposableState.d.ts","sourceRoot":"","sources":["../src/useDisposableState.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,4BAA4B,CAAC;AAElE,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,eAAe,CAAC;AAEjD,OAAO,EAEL,KAAK,eAAe,EAErB,MAAM,+BAA+B,CAAC;AAEvC,KAAK,sCAAsC,CAAC,CAAC,IAAI;IAC/C,KAAK,EAAE,CAAC,CAAC;IACT,QAAQ,EAAE,CAAC,IAAI,EAAE,eAAe,CAAC,OAAO,CAAC,CAAC,EAAE,eAAe,CAAC,CAAC,KAAK,IAAI,CAAC;CACxE,CAAC;AAEF,wBAAgB,kBAAkB,CAAC,CAAC,GAAG,KAAK,EAC1C,WAAW,EAAE,WAAW,CAAC,CAAC,CAAC,GAC1B,sCAAsC,CAAC,CAAC,CAAC,CAqE3C"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"useHasCommittedRef.d.ts","sourceRoot":"","sources":["../src/useHasCommittedRef.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,gBAAgB,EAAqB,MAAM,OAAO,CAAC;
|
|
1
|
+
{"version":3,"file":"useHasCommittedRef.d.ts","sourceRoot":"","sources":["../src/useHasCommittedRef.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,KAAK,gBAAgB,EAAqB,MAAM,OAAO,CAAC;AAEjE;;GAEG;AACH,wBAAgB,kBAAkB,IAAI,gBAAgB,CAAC,OAAO,CAAC,CAM9D"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"useLazyDisposableState.d.ts","sourceRoot":"","sources":["../src/useLazyDisposableState.ts"],"names":[],"mappings":"AAIA,OAAO,EAAE,WAAW,EAAE,MAAM,eAAe,CAAC;
|
|
1
|
+
{"version":3,"file":"useLazyDisposableState.d.ts","sourceRoot":"","sources":["../src/useLazyDisposableState.ts"],"names":[],"mappings":"AAIA,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,eAAe,CAAC;AAEjD,OAAO,EAAE,KAAK,eAAe,EAAE,MAAM,+BAA+B,CAAC;AAErE;;;;;;;;GAQG;AACH,wBAAgB,sBAAsB,CAAC,CAAC,EACtC,WAAW,EAAE,WAAW,CAAC,OAAO,CAAC,CAAC,EAAE,eAAe,CAAC,CAAC,GACpD;IACD,KAAK,EAAE,CAAC,CAAC;CACV,CAoCA"}
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { ItemCleanupPair } from '@isograph/disposable-types';
|
|
1
|
+
import type { ItemCleanupPair } from '@isograph/disposable-types';
|
|
2
2
|
export declare const UNASSIGNED_STATE: unique symbol;
|
|
3
3
|
export type UnassignedState = typeof UNASSIGNED_STATE;
|
|
4
4
|
type UseUpdatableDisposableStateReturnValue<T> = {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"useUpdatableDisposableState.d.ts","sourceRoot":"","sources":["../src/useUpdatableDisposableState.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,eAAe,EAAE,MAAM,4BAA4B,CAAC;
|
|
1
|
+
{"version":3,"file":"useUpdatableDisposableState.d.ts","sourceRoot":"","sources":["../src/useUpdatableDisposableState.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,4BAA4B,CAAC;AAIlE,eAAO,MAAM,gBAAgB,EAAE,OAAO,MAAiB,CAAC;AACxD,MAAM,MAAM,eAAe,GAAG,OAAO,gBAAgB,CAAC;AAEtD,KAAK,sCAAsC,CAAC,CAAC,IAAI;IAC/C,KAAK,EAAE,CAAC,GAAG,eAAe,CAAC;IAC3B,QAAQ,EAAE,CAAC,IAAI,EAAE,eAAe,CAAC,OAAO,CAAC,CAAC,EAAE,eAAe,CAAC,CAAC,KAAK,IAAI,CAAC;CACxE,CAAC;AAoBF;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GA6BG;AACH,wBAAgB,2BAA2B,CACzC,CAAC,GAAG,KAAK,KACN,sCAAsC,CAAC,CAAC,CAAC,CA0D7C"}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@isograph/react-disposable-state",
|
|
3
|
-
"version": "0.0.0-main-
|
|
3
|
+
"version": "0.0.0-main-627be459",
|
|
4
4
|
"description": "Primitives for managing disposable state in React",
|
|
5
5
|
"homepage": "https://isograph.dev",
|
|
6
6
|
"main": "dist/index.js",
|
|
@@ -8,7 +8,7 @@
|
|
|
8
8
|
"author": "Isograph Labs",
|
|
9
9
|
"license": "MIT",
|
|
10
10
|
"dependencies": {
|
|
11
|
-
"@isograph/disposable-types": "0.0.0-main-
|
|
11
|
+
"@isograph/disposable-types": "0.0.0-main-627be459"
|
|
12
12
|
},
|
|
13
13
|
"peerDependencies": {
|
|
14
14
|
"react": "^18.0.0 || ^19.0.0"
|
package/src/CacheItem.test.ts
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { ItemCleanupPair } from '@isograph/disposable-types';
|
|
1
|
+
import type { ItemCleanupPair } from '@isograph/disposable-types';
|
|
2
2
|
import {
|
|
3
3
|
afterEach,
|
|
4
4
|
assert,
|
|
@@ -8,11 +8,8 @@ import {
|
|
|
8
8
|
test,
|
|
9
9
|
vi,
|
|
10
10
|
} from 'vitest';
|
|
11
|
-
import {
|
|
12
|
-
|
|
13
|
-
CacheItemState,
|
|
14
|
-
createTemporarilyRetainedCacheItem,
|
|
15
|
-
} from './CacheItem';
|
|
11
|
+
import type { CacheItem, CacheItemState } from './CacheItem';
|
|
12
|
+
import { createTemporarilyRetainedCacheItem } from './CacheItem';
|
|
16
13
|
|
|
17
14
|
function getState<T>(cacheItem: CacheItem<T>): CacheItemState<T> {
|
|
18
15
|
return (cacheItem as any).__state as CacheItemState<T>;
|
package/src/CacheItem.ts
CHANGED
package/src/ParentCache.test.ts
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import { ItemCleanupPair } from '@isograph/disposable-types';
|
|
1
|
+
import type { ItemCleanupPair } from '@isograph/disposable-types';
|
|
2
2
|
import { assert, describe, expect, test, vi } from 'vitest';
|
|
3
|
-
import { CacheItem } from './CacheItem';
|
|
3
|
+
import type { CacheItem } from './CacheItem';
|
|
4
4
|
import { ParentCache } from './ParentCache';
|
|
5
5
|
|
|
6
6
|
function getValue<T>(cache: ParentCache<T>): CacheItem<T> | null {
|
package/src/ParentCache.ts
CHANGED
|
@@ -1,9 +1,10 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import type {
|
|
2
2
|
CleanupFn,
|
|
3
3
|
Factory,
|
|
4
4
|
ItemCleanupPair,
|
|
5
5
|
} from '@isograph/disposable-types';
|
|
6
|
-
import { CacheItem
|
|
6
|
+
import type { CacheItem } from './CacheItem';
|
|
7
|
+
import { createTemporarilyRetainedCacheItem } from './CacheItem';
|
|
7
8
|
|
|
8
9
|
// TODO convert cache impl to a getter and setter and free functions
|
|
9
10
|
// TODO accept options that get passed to CacheItem
|
|
@@ -1,8 +1,8 @@
|
|
|
1
|
-
import { ItemCleanupPair } from '@isograph/disposable-types';
|
|
1
|
+
import type { ItemCleanupPair } from '@isograph/disposable-types';
|
|
2
2
|
import React, { type MutableRefObject } from 'react';
|
|
3
3
|
import { create } from 'react-test-renderer';
|
|
4
4
|
import { assert, describe, expect, test, vi } from 'vitest';
|
|
5
|
-
import { CacheItem, CacheItemState } from './CacheItem';
|
|
5
|
+
import type { CacheItem, CacheItemState } from './CacheItem';
|
|
6
6
|
import { ParentCache } from './ParentCache';
|
|
7
7
|
import { useCachedResponsivePrecommitValue } from './useCachedResponsivePrecommitValue';
|
|
8
8
|
|
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
'use strict';
|
|
2
2
|
|
|
3
|
-
import { ItemCleanupPair } from '@isograph/disposable-types';
|
|
3
|
+
import type { ItemCleanupPair } from '@isograph/disposable-types';
|
|
4
4
|
import { useEffect, useRef, useState } from 'react';
|
|
5
|
-
import { ParentCache } from './ParentCache';
|
|
5
|
+
import type { ParentCache } from './ParentCache';
|
|
6
6
|
|
|
7
7
|
/**
|
|
8
8
|
* useCachedResponsivePrecommitValue<T>
|
|
@@ -1,10 +1,10 @@
|
|
|
1
|
-
import { ItemCleanupPair } from '@isograph/disposable-types';
|
|
1
|
+
import type { ItemCleanupPair } from '@isograph/disposable-types';
|
|
2
2
|
import { useEffect, useRef } from 'react';
|
|
3
|
-
import { ParentCache } from './ParentCache';
|
|
3
|
+
import type { ParentCache } from './ParentCache';
|
|
4
4
|
import { useCachedResponsivePrecommitValue } from './useCachedResponsivePrecommitValue';
|
|
5
5
|
import {
|
|
6
6
|
UNASSIGNED_STATE,
|
|
7
|
-
UnassignedState,
|
|
7
|
+
type UnassignedState,
|
|
8
8
|
useUpdatableDisposableState,
|
|
9
9
|
} from './useUpdatableDisposableState';
|
|
10
10
|
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { ItemCleanupPair } from '@isograph/disposable-types';
|
|
1
|
+
import type { ItemCleanupPair } from '@isograph/disposable-types';
|
|
2
2
|
import React, { useEffect, useState } from 'react';
|
|
3
3
|
import { create } from 'react-test-renderer';
|
|
4
4
|
import { describe, expect, test, vi } from 'vitest';
|
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
|
|
3
3
|
import type { ItemCleanupPair } from '@isograph/isograph-disposable-types';
|
|
4
4
|
import { useEffect, useRef } from 'react';
|
|
5
|
-
import { ParentCache } from './ParentCache';
|
|
5
|
+
import type { ParentCache } from './ParentCache';
|
|
6
6
|
import { useCachedResponsivePrecommitValue } from './useCachedResponsivePrecommitValue';
|
|
7
7
|
import { type UnassignedState } from './useUpdatableDisposableState';
|
|
8
8
|
|