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

callbag-connect-react

Package Overview
Dependencies
Maintainers
1
Versions
3
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

callbag-connect-react

Connect a react component to callbag(s)

  • 2.0.0
  • Source
  • npm
  • Socket score

Version published
Weekly downloads
0
Maintainers
1
Weekly downloads
 
Created
Source

callbag-connect-react

A utility for connecting a React component with Callbag sources. Comparable to ReactRedux, but for Callbags instead of Redux!

npm install callbag-connect-react

usage

import connect from 'callbag-connect-react

@connect(
  { // Objects are assumed to contain sourcess
    propName: source1,
    ...
  },
  [ // Arrays are assumed to contain signals
    [source2, callback],
    ...
  ]
})
class MyComponent extends React {
  ...
}

Now;

  • Whenever source1 emits data, that will be sent to the propName prop in MyComponent.
  • Whenever source2 emits, callback will be invoked with (componentInstance, emission).

Sources

An object where the keys are prop names and values are sources. When a source emits, the corresponding prop will be populated.

Signals

An array of tuples, each tuple is an array with a source and a callback. Whenever the source emits, the callback will be called with the component instance and the emitted data.

Use signals when you want your component to do something other than render when a source emits.

Keywords

FAQs

Package last updated on 05 May 2018

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