Research
Security News
Malicious npm Packages Inject SSH Backdoors via Typosquatted Libraries
Socket’s threat research team has detected six malicious npm packages typosquatting popular libraries to insert SSH backdoors.
easy-signals
Advanced tools
Easy Signals is a signal library with no dependencies for node, deno and browsers.
Easy Signals is a signal library with no dependencies for node, deno and browsers based on the Angular Signals.
npm install easy-signals
Example on how to use Easy Signals:
import { signal, computed, effect } from 'easy-signals';
const count = signal(0);
const doubleCount = computed(() => count() * 2, count);
effect(() => console.log("effect called, count: ", count()), count);
console.log('doubleCount: ', doubleCount());
count.update((val) => val + 1);
console.log('doubleCount: ', doubleCount());
count.update((val) => val + 1);
console.log('doubleCount: ', doubleCount());
count.set(10);
HTML:
<p>Count is: {{ count() }}</p>
<p>Double Count is: {{ doubleCount() }}</p>
<button (click)="increment()">+1</button>
TypeScript:
import { signal, computed, effect } from 'easy-signals';
count = signal(0);
doubleCount = computed(() => count() * 2, this.count);
increment() {
this.count.update((val) => val + 1);
}
HTML:
<p>Count is: {{ count() }}</p>
<p>Double Count is: {{ doubleCount() }}</p>
<button (click)="increment()">+1</button>
TypeScript:
import { signal, computed, effect } from 'easy-signals';
count = signal(0);
doubleCount = computed(() => count() * 2, this.count);
constructor(private cdr: ChangeDetectorRef) {
effect(() => {
this.cdr.detectChanges();
}, this.count, this.doubleCount);
}
increment() {
this.count.update((val) => val + 1);
}
import { getFile, uploadFilesTo } from 'easy-file-picker';
async getFile(): void {
const file = await getFile();
await uploadFilesTo("http://example.com", file);
}
Creates a new Signal with a intialValue
, the value can be changes using the set
, update
and mutate
functions.
function signal<T>(initialValue: T): Signal<T>
Creates a new ReadonlySignal where the value is the return of the computation
function. The value is updates when the signals
's values are updated.
function computed<T>(computation: () => T,...signals: ReadonlySignal<any>[]): ReadonlySignal<T>
The effectFn
function is called everytime the values from signals
are updated.
function effect(effectFn: () => void,...signals: ReadonlySignal<any>[]): void
Transforms a Signal into a ReadonlySignal.
function asReadonly: () => ReadonlySignal<T>
Sets a new Signal value.
function set: (value: T) => void
Updates the Signal's value with the return of the updateFn
function.
function update: (updateFn: (value: T) => T) => void
Can be used to mutate the Signal's value using the mutatorFn
function.
function mutate: (mutatorFn: (value: T) => void) => void
Version 0.1:
No FAQs for now. (⌐■_■)
FAQs
Easy Signals is a signal library with no dependencies for node, deno and browsers.
The npm package easy-signals receives a total of 1 weekly downloads. As such, easy-signals popularity was classified as not popular.
We found that easy-signals demonstrated a not healthy version release cadence and project activity because the last version was released a year ago. It has 1 open source maintainer collaborating on the project.
Did you know?
Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.
Research
Security News
Socket’s threat research team has detected six malicious npm packages typosquatting popular libraries to insert SSH backdoors.
Security News
MITRE's 2024 CWE Top 25 highlights critical software vulnerabilities like XSS, SQL Injection, and CSRF, reflecting shifts due to a refined ranking methodology.
Security News
In this segment of the Risky Business podcast, Feross Aboukhadijeh and Patrick Gray discuss the challenges of tracking malware discovered in open source softare.