Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

alien-signals

Package Overview
Dependencies
Maintainers
0
Versions
39
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

alien-signals - npm Package Compare versions

Comparing version 0.4.1 to 0.4.2

benchs/propagate.mjs

10

package.json
{
"name": "alien-signals",
"version": "0.4.1",
"version": "0.4.2",
"license": "MIT",

@@ -38,10 +38,12 @@ "packageManager": "pnpm@9.12.0",

"build:cjs": "esbuild src/index.ts --bundle --format=cjs --outfile=cjs/index.cjs",
"test": "vitest run"
"test": "vitest run",
"bench": "npm run build:esm && node --jitless --expose-gc benchs/propagate.mjs"
},
"devDependencies": {
"esbuild": "latest",
"mitata": "latest",
"typescript": "latest",
"vite": "latest",
"vitest": "latest",
"typescript": "latest"
"vitest": "latest"
}
}

8

types/computed.d.ts
import { IComputed, Link, SubscriberFlags } from './system.js';
export interface ISignal<T = any> {
get(): T;
}
export declare function computed<T>(getter: (cachedValue?: T) => T): ISignal<T>;
export declare class Computed<T = any> implements IComputed {
import type { ISignal } from './types.js';
export declare function computed<T>(getter: (cachedValue?: T) => T): Computed<T>;
export declare class Computed<T = any> implements IComputed, ISignal<T> {
getter: (cachedValue?: T) => T;

@@ -8,0 +6,0 @@ cachedValue: T | undefined;

@@ -7,3 +7,3 @@ import { Dependency, IEffect, Link, Subscriber, SubscriberFlags } from './system.js';

export declare function nextTrackId(): number;
export declare function effect(fn: () => void): Effect<void>;
export declare function effect<T>(fn: () => T): Effect<T>;
export declare class Effect<T = any> implements IEffect, Dependency {

@@ -14,3 +14,2 @@ fn: () => T;

subsTail: Link | undefined;
lastTrackedId: number;
deps: Link | undefined;

@@ -17,0 +16,0 @@ depsTail: Link | undefined;

@@ -6,2 +6,3 @@ export * from './computed.js';

export * from './system.js';
export * from './types.js';
export * as Unstable from './unstable/index.js';

@@ -1,9 +0,6 @@

import { ISignal } from './computed.js';
import { Dependency, Link } from './system.js';
export interface IWritableSignal<T = any> extends ISignal<T> {
set(value: T): void;
}
import type { IWritableSignal } from './types.js';
export declare function signal<T>(): Signal<T | undefined>;
export declare function signal<T>(oldValue: T): Signal<T>;
export declare class Signal<T = any> implements Dependency {
export declare class Signal<T = any> implements Dependency, IWritableSignal<T> {
currentValue: T;

@@ -10,0 +7,0 @@ subs: Link | undefined;

@@ -12,3 +12,3 @@ export interface IEffect extends Subscriber {

subsTail: Link | undefined;
lastTrackedId: number;
lastTrackedId?: number;
}

@@ -15,0 +15,0 @@ export interface Subscriber {

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc