New Research: Supply Chain Attack on Axios Pulls Malicious Dependency from npm.Details
Socket
Book a DemoSign in
Socket

callbag-component

Package Overview
Dependencies
Maintainers
1
Versions
5
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

callbag-component

Web Component Library based on callbag

latest
Source
npmnpm
Version
0.1.0
Version published
Weekly downloads
11
1000%
Maintainers
1
Weekly downloads
 
Created
Source

callbag-component

callbag-component is wrapper of Custom element 1.0 API.

Provides reactive custom element via callbag

API

Component

component(intent$, model$, view$)

ArgumentsDescription
intent$takes DOM element(connected component). returns source of intent
model$takes source of intent. returns source of model
view$takes source of model. returns source of DOM Node, which will replace custom element's children

Example:

import { component, fromIntent } from 'callbag-component';
import fromEvent from 'callbag-from-event';
import map from 'callbag-map';

const Counter = component(
  element => fromEvent(element, 'click'),
  fromIntent(prev => prev + 1, 0),
  map(count => document.createTextNode(`count: ${count}`)),
);

fromIntent(reducer, preloadedModel)

ArgumentsDescription
reducertakes lastly calculated model and lastly produced intent, returns new model
preloadedModelinitial model
import { component, fromIntent } from 'callbag-component';
import fromEvent from 'callbag-from-event';
import map from 'callbag-map';

const Counter = component(
  element => fromEvent(element, 'click'),
  fromIntent(prev => prev + 1, 0),
  map(count => document.createTextNode(`count: ${count}`)),
);

FAQs

Package last updated on 12 Jan 2019

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