Socket
Socket
Sign inDemoInstall

fleuvejs

Package Overview
Dependencies
Maintainers
1
Versions
25
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

fleuvejs

A simple JavaScript Observable Library


Version published
Weekly downloads
6
decreased by-40%
Maintainers
1
Weekly downloads
 
Created
Source

FleuveJS

A simple Observable Utility library

Installation

npm i fleuvejs

To use for frontend projects, for now you can use the latest version with UnPkg:

import { Fleuve } from 'https://unpkg.com/fleuvejs@latest/index.js';

How To Use

Instantiate a Fleuve

const johnDoe$ = new Fleuve({firstname: 'john', lastname: 'doe'});
const counter$ = new Fleuve(0);

Provide new values

const fleuve$ = new Fleuve(0);
fleuve$.next(12, 13, 14, 15, 16);
fleuve$.next((x) => x + 1, (x) => x * 2);

// This one will throw an error
fleuve$.next(12, (x) => x + 1);

Pipe the Fleuve

const fleuve$ = new Fleuve(18729);
const sum$ = fleuve$.pipe(
    (x) => (x + '').split(''), 
    (numbers) => numbers.reduce((acc, curr) => acc + curr, 0)
);

Subscribe

const fleuve$ = new Fleuve(12;
fleuve$.subscribe((value) => console.log(value));

// This one will throw an error
fleuve$.subscribe(42);

Nex Features

Allow to specify a event handler:

<button id="clickMe">Click Me</button>
const fleuve$ = new Fleuve();
fleuve$.addEventListener('#clickMe', (event, x) => console.log(event, x))

Allow to work with Promises

Allow to work with RxJs Observables

More operators

Keywords

FAQs

Package last updated on 10 Jun 2021

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