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

@cycle/notification

Package Overview
Dependencies
Maintainers
2
Versions
2
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@cycle/notification

Cycle.js driver for HTML5 Notifications

  • 2.0.0
  • latest
  • Source
  • npm
  • Socket score

Version published
Maintainers
2
Created
Source

Cycle Notification Driver

A Cycle.js Driver for showing and responding to HTML5 Notifications.

npm install @cycle/notification

Usage

Basics:

import Cycle from '@cycle/core';
import { makeNotificationDriver } from '@cycle/notification'

function main({notification}) {
  // ...
}

const drivers = {
  notification: makeNotificationDriver()
}

Cycle.run(main, drivers)

Simple and normal use case:

function main({notification}) {

    let notifications$ = Rx.Observable
            .interval(10000)
            .startWith(-1)
            .map( (value) => ({
                title: 'Test Notification',
                body: `Interval ${value}`,
                tag: 'test-notification',
                icon: 'data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAUAAAAFCAIAAAACDbGyAAAAEUlEQVQIW2Pg3uSLjBgo5AMACSoZ+1zqJ8AAAAAASUVORK5CYII='
            }) )
            .take(10),
        show$ = notification.get('show'),
        click$ = notification.get('click'),
        error$ = notification.get('error'),
        close$ = notification.get('close'),
        all$ = Rx.Observable.merge(show$, click$, error$, close$)

    all$.do(args => console.log(args)).subscribe()

    return {
        notification: notifications$
    }
}

Keywords

FAQs

Package last updated on 31 Mar 2016

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