New Case Study:See how Anthropic automated 95% of dependency reviews with Socket.Learn More
Socket
Sign inDemoInstall
Socket

observable-signal

Package Overview
Dependencies
Maintainers
1
Versions
2
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

observable-signal

Observable and Signals merged together to support imperative and functional reactive paradigms

  • 0.1.2
  • latest
  • Source
  • npm
  • Socket score

Version published
Weekly downloads
0
Maintainers
1
Weekly downloads
 
Created
Source

Observable Signal

A hybrid state manager implementing the Signal and the Observable interfaces to support imperative-reactive and functional-reactive programming paradigms.

Example

import { ObservableSignal } from 'observable-signal';
import { map } from 'rxjs/operators';
import { rml } from 'rimmel';

export const Button = () => {
  const [ state, setState ] = ObservableSignal(0);

  const derivedState = state.pipe(
    map(x => x*2)
  );

  return rml`
    <button onclick="${(e: Event) => setState(state +1)}">Increment</button> 
    <button onclick="${(e: Event) => state.next(0)}">Zero</button>

    <hr>

    Master state: <span>${state}</span><br>
    Derived state: <span>${derivedState}</span><br>
  `;
};

document.body.innerHTML = Button();

Playground

https://stackblitz.com/edit/observable-signal

Keywords

FAQs

Package last updated on 19 May 2024

Did you know?

Socket

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.

Install

Related posts

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