Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

pancetta

Package Overview
Dependencies
Maintainers
1
Versions
1
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

pancetta

A lightweight FRP framework based on Bacon.js

  • 0.1.0
  • latest
  • Source
  • npm
  • Socket score

Version published
Weekly downloads
2
Maintainers
1
Weekly downloads
 
Created
Source

Pancetta

A lightweight FRP library based on Bacon.js

Usage

var input = Pancetta.fromEvent($('#new-message'), 'keydown')

input.filter(function(event) {
  return event.which === 13;
}).map(function(event) {
  return event.target.value;
}).flatMap(function(message) {
  return Pancetta.fromPromise($.post('/restAPI', message));
}).scan(function(messages, newMessage) {
  return messages.concat([newMessage]);
}, []).map(Handlebars.compile(
  '{{#each this}}<li>{{this}}</li>{{/each}}'
)).subscribe(function(markup) {
  $('#messages').html(markup);
});
var submits = Pancetta.fromEvent($('#my-form'), 'submit').do(function(event) {
  event.preventDefault();
}).map(function(event) {
  return $(event.target).serialize();
}).flatMap(function(data) {
  return Pancetta.fromPromise($.post('/new-submission', data));
}).scan(function(submissions, submission) {
  return submissions.concat([submission]);
}, []);

submits.subscribe(function(submissions) {
  React.renderComponent(SubsView({submissions: submissions}), $('#subs'));
});

FAQs

Package last updated on 02 Sep 2014

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