@isograph/reference-counted-pointer 0.1.1 → 0.3.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.
- package/dist/createReferenceCountedPointer.d.ts +2 -1
- package/dist/createReferenceCountedPointer.d.ts.map +1 -0
- package/dist/createReferenceCountedPointer.js +2 -3
- package/dist/index.d.ts +1 -0
- package/dist/index.d.ts.map +1 -0
- package/package.json +7 -9
- package/src/createReferenceCountedPointer.ts +1 -1
- package/tsconfig.json +6 -0
@@ -6,7 +6,7 @@ import type { ItemCleanupPair } from '@isograph/disposable-types';
|
|
6
6
|
* disposed, the underlying item will be disposed.
|
7
7
|
*
|
8
8
|
* Additional reference-counted pointers guarding the same item can be
|
9
|
-
* created by calling
|
9
|
+
* created by calling cloneIfNotDisposed().
|
10
10
|
*
|
11
11
|
* ## Structural sharing
|
12
12
|
*
|
@@ -31,3 +31,4 @@ export interface ReferenceCountedPointer<T> {
|
|
31
31
|
getItemIfNotDisposed(): T | null;
|
32
32
|
cloneIfNotDisposed(): ItemCleanupPair<ReferenceCountedPointer<T>> | null;
|
33
33
|
}
|
34
|
+
//# sourceMappingURL=createReferenceCountedPointer.d.ts.map
|
@@ -0,0 +1 @@
|
|
1
|
+
{"version":3,"file":"createReferenceCountedPointer.d.ts","sourceRoot":"","sources":["../src/createReferenceCountedPointer.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAa,eAAe,EAAE,MAAM,4BAA4B,CAAC;AAI7E;;;;;;;;;;;;;;;;;;;;;GAqBG;AACH,wBAAgB,6BAA6B,CAAC,CAAC,EAC7C,IAAI,EAAE,eAAe,CAAC,CAAC,CAAC,GACvB,eAAe,CAAC,uBAAuB,CAAC,CAAC,CAAC,CAAC,CAI7C;AAED,MAAM,WAAW,uBAAuB,CAAC,CAAC;IACxC,UAAU,IAAI,OAAO,CAAC;IACtB;;;OAGG;IACH,oBAAoB,IAAI,CAAC,GAAG,IAAI,CAAC;IACjC,kBAAkB,IAAI,eAAe,CAAC,uBAAuB,CAAC,CAAC,CAAC,CAAC,GAAG,IAAI,CAAC;CAC1E"}
|
@@ -1,6 +1,6 @@
|
|
1
1
|
"use strict";
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
3
|
-
exports.createReferenceCountedPointer =
|
3
|
+
exports.createReferenceCountedPointer = createReferenceCountedPointer;
|
4
4
|
// TODO cloneIfNotDisposed should also return the underlying item
|
5
5
|
/**
|
6
6
|
* Create an undisposed reference-counted pointer guarding a given item.
|
@@ -9,7 +9,7 @@ exports.createReferenceCountedPointer = void 0;
|
|
9
9
|
* disposed, the underlying item will be disposed.
|
10
10
|
*
|
11
11
|
* Additional reference-counted pointers guarding the same item can be
|
12
|
-
* created by calling
|
12
|
+
* created by calling cloneIfNotDisposed().
|
13
13
|
*
|
14
14
|
* ## Structural sharing
|
15
15
|
*
|
@@ -28,7 +28,6 @@ function createReferenceCountedPointer(pair) {
|
|
28
28
|
const originalReferenceCountedPointer = new RefCounter(pair);
|
29
29
|
return originalReferenceCountedPointer.retainIfNotDisposed();
|
30
30
|
}
|
31
|
-
exports.createReferenceCountedPointer = createReferenceCountedPointer;
|
32
31
|
// N.B. this could implement ReferenceCountedPointer<T>, but it would not be correct to use it
|
33
32
|
// as such, since it does not have an associated dispose function that can be called.
|
34
33
|
//
|
package/dist/index.d.ts
CHANGED
@@ -0,0 +1 @@
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,cAAc,iCAAiC,CAAC"}
|
package/package.json
CHANGED
@@ -1,6 +1,6 @@
|
|
1
1
|
{
|
2
2
|
"name": "@isograph/reference-counted-pointer",
|
3
|
-
"version": "0.
|
3
|
+
"version": "0.3.0",
|
4
4
|
"description": "Reference counted pointers enable sharing of disposable items.",
|
5
5
|
"homepage": "https://isograph.dev",
|
6
6
|
"main": "dist/index.js",
|
@@ -12,21 +12,19 @@
|
|
12
12
|
"compile-watch": "tsc -p tsconfig.pkg.json --watch",
|
13
13
|
"test": "vitest run",
|
14
14
|
"test-watch": "vitest watch",
|
15
|
-
"coverage": "vitest run --coverage"
|
15
|
+
"coverage": "vitest run --coverage",
|
16
|
+
"tsc": "tsc"
|
16
17
|
},
|
17
18
|
"dependencies": {
|
18
|
-
"@isograph/disposable-types": "
|
19
|
-
"react": "^18.2.0"
|
19
|
+
"@isograph/disposable-types": "*"
|
20
20
|
},
|
21
21
|
"devDependencies": {
|
22
|
-
"
|
23
|
-
"react-test-renderer": "^18.2.0",
|
24
|
-
"typescript": "^5.0.3",
|
25
|
-
"vitest": "^0.29.8"
|
22
|
+
"typescript": "5.6.3"
|
26
23
|
},
|
27
24
|
"repository": {
|
28
25
|
"type": "git",
|
29
26
|
"url": "git+https://github.com/isographlabs/isograph.git",
|
30
27
|
"directory": "libs/isograph-reference-counted-pointer"
|
31
|
-
}
|
28
|
+
},
|
29
|
+
"sideEffects": false
|
32
30
|
}
|
@@ -9,7 +9,7 @@ import type { CleanupFn, ItemCleanupPair } from '@isograph/disposable-types';
|
|
9
9
|
* disposed, the underlying item will be disposed.
|
10
10
|
*
|
11
11
|
* Additional reference-counted pointers guarding the same item can be
|
12
|
-
* created by calling
|
12
|
+
* created by calling cloneIfNotDisposed().
|
13
13
|
*
|
14
14
|
* ## Structural sharing
|
15
15
|
*
|