npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2026 – Pkg Stats / Ryan Hefner

solid-global-owning

v0.0.1

Published

This package provides a way to run code within a global SolidJS root owner, useful for managing global state or context in SolidJS applications.

Readme

solid-global-owning

This package provides a way to run code within a global SolidJS root owner, useful for managing global state or context in SolidJS applications.

Installation

bun add solid-global-owning
# or
npm install solid-global-owning

Usage Examples

1. Working with the Global Scope

import { runGlobal, disposeRoot, getAllScopes } from "solid-global-owning";
import { createSignal, createEffect } from "solid-js";

// Setup signals outside the runGlobal scope
const [count, setCount] = createSignal(0);

// Register an effect in the default global owner
runGlobal(() => {
	createEffect(() => {
		console.log("Count is", count());
	});
});
setCount(1); // Triggers the effect

// List all active scopes
console.log(getAllScopes()); // ["global"]

// Dispose the default global root and cleanup all effects
disposeRoot();

2. Working with Custom Namespaces

import { runGlobal, disposeRoot, getAllScopes } from "solid-global-owning";
import { createSignal, createEffect } from "solid-js";

const [msg, setMsg] = createSignal("hello");

// Register an effect in a custom namespace
runGlobal(() => {
	createEffect(() => {
		console.log("Message:", msg());
	});
}, "my-scope");
setMsg("world");

// List all active scopes
console.log(getAllScopes()); // ["global", "my-scope"]

// Dispose a specific root and cleanup all effects in that scope
disposeRoot("my-scope");

API

runGlobal(fn, ns?)

Runs a function within a SolidJS root for the given namespace (default: "global"). Useful for registering effects or computations in a specific owner context. | Argument | Type | Required | Default | Description | |----------|----------|----------|----------|---------------------------------------------| | fn | function | Yes | — | Function to run in the SolidJS root owner | | ns | string | No | "global" | Namespace/scope ID for the root |

disposeRoot(ns?, retainOriginalObjects?)

Disposes the root for a given namespace, cleaning up all effects and computations registered in that scope. | Argument | Type | Required | Default | Description | |----------------------|---------|----------|-----------|---------------------------------------------| | ns | string | No | "global" | Namespace/scope ID to dispose | | retainOriginalObjects| boolean | No | false | If true, keeps the scope in the map |

disposeAll(retainOriginalObjects?)

Disposes all roots and cleans up all effects and computations in every namespace. | Argument | Type | Required | Default | Description | |----------------------|---------|----------|---------|---------------------------------------------| | retainOriginalObjects| boolean | No | false | If true, keeps all scopes in the map |

getAllScopes()

Returns an array of all active scope IDs (namespaces) currently managed. | Argument | Type | Required | Default | Description | |----------|------|----------|---------|---------------------| | — | — | — | — | Returns all scope IDs |

getScopeOwner(id?)

Returns the internal SolidJS owner object for a specific namespace (default: "global"). This is of type ReturnType<typeof getOwner> or undefined if not found. Useful for advanced SolidJS integrations.

| Argument | Type | Required | Default | Description | |----------|--------|----------|----------|----------------------------------| | id | string | No | "global" | Namespace/scope ID to get owner |

Returns: ReturnType<typeof getOwner> | undefined

disposeDefaultGlobal()

Disposes the default global root and cleans up all effects and computations registered in it. | Argument | Type | Required | Default | Description | |----------|------|----------|---------|----------------------------| | — | — | — | — | Disposes the default global root |


Main entry: index.js
Type definitions: index.d.ts
Peer dependencies: typescript, solid-js