
Company News
Socket Named Top Sales Organization by RepVue
Socket won two 2026 Reppy Awards from RepVue, ranking in the top 5% of all sales orgs. AE Alexandra Lister shares what it's like to grow a sales career here.
@alcadica/signal
Advanced tools
A signal is basically a function with a subscription system bound to it.
npm i --save @alcadica/signal
A real-life example:
// file CounterAspect.ts
import signal from '@alcadica/signal';
export const increment: signal = signal();
export const dispose: signal = signal();
export const stateDidChange: signal = signal();
export const state = {
counter: 0
}
export default {
dispose,
increment,
state,
stateDidChange
}
increment.connect(() => {
state.counter++;
});
// my-component.tsx
import * as React from 'react';
import CounterAspect from './CounterAspect';
export class MyComponent extends React.Component<any, any> {
public state: any = CounterAspect.state;
public componentDidMount(): void {
const signalid = CounterAspect.stateDidChange.connect((key, value) => this.setState({ [key]: value }));
CounterAspect.dispose.connect(() => CounterAspect.stateDidChange.disconnect(signalid));
}
public componentWillUnmount(): void {
CounterAspect.dispose();
}
public render(): JSX.Element {
return (
<div onClick={CounterAspect.increment}>{CounterAspect.state.counter}</div>
)
}
}
A signal subscription can also be consumed only once
import signal from '@alcadica/signal';
const foo = { bar: 0 }
const baz = signal<[number]>();
baz.connectOnce(arg => foo.bar = foo.bar + arg);
baz(1) // foo.bar is 1
baz(1) // foo.bar is still 1
baz(1) // foo.bar is still 1 again
FAQs
Signals for typescript
We found that @alcadica/signal demonstrated a not healthy version release cadence and project activity because the last version was released a year ago. It has 2 open source maintainers 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.

Company News
Socket won two 2026 Reppy Awards from RepVue, ranking in the top 5% of all sales orgs. AE Alexandra Lister shares what it's like to grow a sales career here.

Security News
NIST will stop enriching most CVEs under a new risk-based model, narrowing the NVD's scope as vulnerability submissions continue to surge.

Company News
/Security News
Socket is an initial recipient of OpenAI's Cybersecurity Grant Program, which commits $10M in API credits to defenders securing open source software.