{"id":18541317,"url":"https://github.com/cyclejs/cycle-notification-driver","last_synced_at":"2025-04-09T18:31:04.512Z","repository":{"id":57105193,"uuid":"39382954","full_name":"cyclejs/cycle-notification-driver","owner":"cyclejs","description":null,"archived":false,"fork":false,"pushed_at":"2016-03-31T20:08:09.000Z","size":491,"stargazers_count":22,"open_issues_count":2,"forks_count":6,"subscribers_count":11,"default_branch":"master","last_synced_at":"2024-10-30T00:55:12.838Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"language":"JavaScript","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/cyclejs.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2015-07-20T12:40:59.000Z","updated_at":"2022-10-27T18:37:44.000Z","dependencies_parsed_at":"2022-08-20T23:50:07.171Z","dependency_job_id":null,"html_url":"https://github.com/cyclejs/cycle-notification-driver","commit_stats":null,"previous_names":[],"tags_count":8,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/cyclejs%2Fcycle-notification-driver","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/cyclejs%2Fcycle-notification-driver/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/cyclejs%2Fcycle-notification-driver/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/cyclejs%2Fcycle-notification-driver/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/cyclejs","download_url":"https://codeload.github.com/cyclejs/cycle-notification-driver/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":247347232,"owners_count":20924361,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":[],"created_at":"2024-11-06T20:04:41.977Z","updated_at":"2025-04-09T18:31:04.478Z","avatar_url":"https://github.com/cyclejs.png","language":"JavaScript","funding_links":[],"categories":["Libraries"],"sub_categories":["Drivers"],"readme":"# Cycle Notification Driver\n\nA [Cycle.js](http://cycle.js.org) [Driver](http://cycle.js.org/drivers.html) for showing and responding to HTML5 Notifications.\n\n```\nnpm install @cycle/notification\n```\n\n## Usage\n\nBasics:\n\n```js\nimport Cycle from '@cycle/core';\nimport { makeNotificationDriver } from '@cycle/notification'\n\nfunction main({notification}) {\n  // ...\n}\n\nconst drivers = {\n  notification: makeNotificationDriver()\n}\n\nCycle.run(main, drivers)\n```\n\nSimple and normal use case:\n\n```js\nfunction main({notification}) {\n\n    let notifications$ = Rx.Observable\n            .interval(10000)\n            .startWith(-1)\n            .map( (value) =\u003e ({\n                title: 'Test Notification',\n                body: `Interval ${value}`,\n                tag: 'test-notification',\n                icon: 'data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAUAAAAFCAIAAAACDbGyAAAAEUlEQVQIW2Pg3uSLjBgo5AMACSoZ+1zqJ8AAAAAASUVORK5CYII='\n            }) )\n            .take(10),\n        show$ = notification.get('show'),\n        click$ = notification.get('click'),\n        error$ = notification.get('error'),\n        close$ = notification.get('close'),\n        all$ = Rx.Observable.merge(show$, click$, error$, close$)\n\n    all$.do(args =\u003e console.log(args)).subscribe()\n\n    return {\n        notification: notifications$\n    }\n}\n```\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fcyclejs%2Fcycle-notification-driver","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fcyclejs%2Fcycle-notification-driver","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fcyclejs%2Fcycle-notification-driver/lists"}