
Security News
upm Launches as a Fast, Tiny Package Manager Written in TypeScript
upm uses Node.js to deliver fast npm installs in about 250 KB, with a JavaScript API and security defaults.
@solid-primitives/trigger
Advanced tools
A set of primitives based on Solid signals, used to trigger computations.
A set of primitives based on Solid signals, used to trigger computations.
createTrigger - Set listeners in reactive computations and then trigger them when you want.createTriggerCache - Creates a cache of triggers that can be used to mark dirty only specific keys.npm install @solid-primitives/trigger
# or
yarn add @solid-primitives/trigger
# or
pnpm add @solid-primitives/trigger
createTriggerSet listeners in reactive computations and then trigger them when you want.
import { createTrigger } from "@solid-primitives/trigger";
const [track, dirty] = createTrigger();
createEffect(() => {
track();
// ...
});
// later
dirty();
createTriggerCacheCreates a cache of triggers that can be used to mark dirty only specific keys.
Cache is a Map or WeakMap depending on the mapConstructor argument. (default: Map)
If mapConstructor is WeakMap then the cache will be weak and the keys will be garbage collected when they are no longer referenced.
Trigger signals added to the cache only when tracked under a computation, and get deleted from the cache when they are no longer tracked.
track and dirty are called with a key so that each tracker will trigger an update only when his individual key would get marked as dirty.
import { createTriggerCache } from "@solid-primitives/trigger";
const map = createTriggerCache<number>();
createEffect(() => {
map.track(1);
// ...
});
// later
map.dirty(1);
// this won't cause an update:
map.dirty(2);
createTriggerCache constructor can take a WeakMap constructor as an argument. This will create a WeakMap of triggers instead of a Map.
const map = createTriggerCache<object>(WeakMap);
const obj = {};
createEffect(() => {
map.track(obj);
// ...
});
// later
map.dirty(obj);
TODO
See CHANGELOG.md
FAQs
A set of primitives based on Solid signals, used to trigger computations.
The npm package @solid-primitives/trigger receives a total of 1,318,903 weekly downloads. As such, @solid-primitives/trigger popularity was classified as popular.
We found that @solid-primitives/trigger demonstrated a healthy version release cadence and project activity because the last version was released less than a year ago. It has 3 open source maintainers collaborating on the project.

Security News
upm uses Node.js to deliver fast npm installs in about 250 KB, with a JavaScript API and security defaults.

Company News
Socket is joining the OpenJS Security Stewardship Program to fund Node.js vulnerability research, maintainer remediation, and security releases.

Security News
Two compromised GitHub Actions were re-enabled with malicious tags intact, exposing thousands of downstream repositories to Mini Shai-Hulud.