{"id":17772556,"url":"https://github.com/jamesplease/cycle-connection-driver","last_synced_at":"2025-05-13T00:10:52.645Z","repository":{"id":66133749,"uuid":"56033820","full_name":"jamesplease/cycle-connection-driver","owner":"jamesplease","description":"A Cycle.js driver for connection status","archived":false,"fork":false,"pushed_at":"2016-04-13T00:32:30.000Z","size":23,"stargazers_count":4,"open_issues_count":0,"forks_count":2,"subscribers_count":0,"default_branch":"master","last_synced_at":"2025-04-16T00:13:24.936Z","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/jamesplease.png","metadata":{"files":{"readme":"README.md","changelog":"CHANGELOG.md","contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2016-04-12T05:28:07.000Z","updated_at":"2024-03-28T00:22:17.000Z","dependencies_parsed_at":"2023-04-12T10:36:07.092Z","dependency_job_id":null,"html_url":"https://github.com/jamesplease/cycle-connection-driver","commit_stats":null,"previous_names":["jmeas/cycle-connection-driver"],"tags_count":3,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/jamesplease%2Fcycle-connection-driver","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/jamesplease%2Fcycle-connection-driver/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/jamesplease%2Fcycle-connection-driver/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/jamesplease%2Fcycle-connection-driver/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/jamesplease","download_url":"https://codeload.github.com/jamesplease/cycle-connection-driver/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":253843216,"owners_count":21972874,"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-10-26T21:39:46.290Z","updated_at":"2025-05-13T00:10:52.612Z","avatar_url":"https://github.com/jamesplease.png","language":"JavaScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"# cycle-connection-driver\n\nA Cycle.js driver for connection status\n\n[![Travis build status](http://img.shields.io/travis/jmeas/cycle-connection-driver.svg?style=flat)](https://travis-ci.org/jmeas/cycle-connection-driver)\n[![Code Climate](https://codeclimate.com/github/jmeas/cycle-connection-driver/badges/gpa.svg)](https://codeclimate.com/github/jmeas/cycle-connection-driver)\n[![Test Coverage](https://codeclimate.com/github/jmeas/cycle-connection-driver/badges/coverage.svg)](https://codeclimate.com/github/jmeas/cycle-connection-driver)\n[![Dependency Status](https://david-dm.org/jmeas/cycle-connection-driver.svg)](https://david-dm.org/jmeas/cycle-connection-driver)\n[![devDependency Status](https://david-dm.org/jmeas/cycle-connection-driver/dev-status.svg)](https://david-dm.org/jmeas/cycle-connection-driver#info=devDependencies)\n\n### Motivation\n\nMany web apps respond to when a user goes online or offline. For example, Slack\ndisplays a warning message and prevents you from typing a new message when you\ngo offline.\n\nThis driver helps you respond to changes to a user's connection status within Cycle.js.\n\n### Installation\n\nThe recommended installation method is through [npm](https://www.npmjs.com/):\n\n```sh\nnpm install cycle-connection-driver\n```\n\n### Getting Started\n\nThe output of this driver is a single Observable. This Observable emits one of\ntwo values: `\"online\"` and `\"offline\"`, corresponding to whether the user has\nbecome connected or disconnected. The initial value of the stream is the user's\nconnection status at the time that your app's main function is passed to `run`.\n\nThis driver accepts no sinks.\n\n```js\nimport {run} from '@cycle/core';\nimport {makeDOMDriver, div} from '@cycle/dom';\nimport cycleConnectionDriver from 'cycle-connection-driver';\n\nfunction main({Connection}) {\n  return {\n    DOM: Connection.map(connectionStatus =\u003e\n      div('.connection-status', `Connection - Currently ${connectionStatus}`)\n    )\n  };\n}\n\nrun(main, {\n  DOM: makeDOMDriver('.app'),\n  Connection: cycleConnectionDriver\n});\n```\n\n### When Not To Use This Library\n\nThis is a small module. You're free to download it from npm – it's not going\nanywhere – but you could also copy and paste it into your own application.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fjamesplease%2Fcycle-connection-driver","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fjamesplease%2Fcycle-connection-driver","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fjamesplease%2Fcycle-connection-driver/lists"}