@solid-primitives/rootless
Advanced tools
Comparing version
@@ -0,1 +1,3 @@ | ||
"use strict"; | ||
// src/index.ts | ||
@@ -34,3 +36,3 @@ import { asArray, access } from "@solid-primitives/utils"; | ||
queueMicrotask(() => { | ||
if (listeners) | ||
if (listeners || !dispose) | ||
return; | ||
@@ -37,0 +39,0 @@ dispose(); |
{ | ||
"name": "@solid-primitives/rootless", | ||
"version": "1.1.0", | ||
"version": "1.1.1", | ||
"description": "A collection of helpers that aim to simplify using reactive primitives outside of reactive roots, and managing disposal of reactive roots.", | ||
@@ -42,12 +42,12 @@ "author": "Damian Tarnawski @thetarnav <gthetarnav@gmail.com>", | ||
"dependencies": { | ||
"@solid-primitives/utils": "^1.0.0" | ||
"@solid-primitives/utils": "^2.2.1" | ||
}, | ||
"devDependencies": { | ||
"jsdom": "^19.0.0", | ||
"prettier": "^2.5.1", | ||
"solid-register": "^0.1.5", | ||
"tslib": "^2.3.1", | ||
"tsup": "^5.11.11", | ||
"typescript": "^4.5.4", | ||
"uvu": "^0.5.2" | ||
"prettier": "^2.7.1", | ||
"solid-register": "^0.2.5", | ||
"tslib": "^2.4.0", | ||
"tsup": "^6.1.3", | ||
"typescript": "^4.7.4", | ||
"uvu": "^0.5.6" | ||
}, | ||
@@ -57,2 +57,2 @@ "peerDependencies": { | ||
} | ||
} | ||
} |
@@ -7,3 +7,3 @@ <p> | ||
[](https://lerna.js.org/) | ||
[](https://turborepo.org/) | ||
[](https://bundlephobia.com/package/@solid-primitives/rootless) | ||
@@ -136,3 +136,5 @@ [](https://www.npmjs.com/package/@solid-primitives/rootless) | ||
```ts | ||
const useState = createSharedScope(() => { | ||
import { createSharedRoot } from "@solid-primitives/rootless"; | ||
const useState = createSharedRoot(() => { | ||
return createMemo(() => {...}) | ||
@@ -157,2 +159,6 @@ }); | ||
### Demo | ||
Usage of combining `createSharedRoot` with `createMousePosition`: https://codesandbox.io/s/shared-root-demo-fjl1l9?file=/index.tsx | ||
## Changelog | ||
@@ -159,0 +165,0 @@ |
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
15379
3.19%195
1.04%180
3.45%+ Added
- Removed