{"id":22690100,"url":"https://github.com/web-mech/can-stream-x","last_synced_at":"2025-06-18T23:38:17.761Z","repository":{"id":57193488,"uuid":"88943814","full_name":"web-mech/can-stream-x","owner":"web-mech","description":"Stream values into and out of computes","archived":false,"fork":false,"pushed_at":"2017-05-03T21:22:33.000Z","size":27,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":2,"default_branch":"master","last_synced_at":"2025-06-07T06:36:53.719Z","etag":null,"topics":["baconjs","can-stream","canjs","kefir","rxjs","stream"],"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/web-mech.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}},"created_at":"2017-04-21T05:19:00.000Z","updated_at":"2017-04-21T05:41:39.000Z","dependencies_parsed_at":"2022-09-01T00:52:50.987Z","dependency_job_id":null,"html_url":"https://github.com/web-mech/can-stream-x","commit_stats":null,"previous_names":[],"tags_count":6,"template":false,"template_full_name":null,"purl":"pkg:github/web-mech/can-stream-x","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/web-mech%2Fcan-stream-x","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/web-mech%2Fcan-stream-x/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/web-mech%2Fcan-stream-x/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/web-mech%2Fcan-stream-x/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/web-mech","download_url":"https://codeload.github.com/web-mech/can-stream-x/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/web-mech%2Fcan-stream-x/sbom","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":260653881,"owners_count":23042647,"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":["baconjs","can-stream","canjs","kefir","rxjs","stream"],"created_at":"2024-12-10T00:26:11.153Z","updated_at":"2025-06-18T23:38:12.729Z","avatar_url":"https://github.com/web-mech.png","language":"JavaScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"# can-stream-x\n\n[![Build Status](https://travis-ci.org/web-mech/can-stream-x.svg?branch=master)](https://travis-ci.org/web-mech/can-stream-x)\n\nStream values into and out of computes using any streaming lib.\nGreat for streaming libs that return emitters as a callback.\n\n## Syntax\n\n```\ncanStreamX([options]);\n```\n\n### Notes\n - Passing falsey values for the emitter flag makes indicates the emitter is a function and should be called directly.\n - Passing falsey values for the unsubscribe method indicates the unsubscribe method is derived from the subscribe method.\n\n### Options\n - streamConstructor - \u003cFunction\u003e method necessary to create a stream.\n - emitMethod - \u003cstring\u003e Which method to use as the emitter.\n - on - \u003cstring\u003e Which method to use to subscribe.\n - off - \u003cstring\u003e Which method to use to unsubscribe.\n\n## Example Usage\n\n### Using RxJs\n\n```\nvar canStreamX = require('./can-stream-x');\nvar Rx = require('rxjs');\nvar Observable = Rx.Observable;\n\nvar canStream = canStreamX({\n\tstreamConstructor: Observable.create,\n    emitMethod: 'next',\n    on: 'subscribe',\n    off: 'unsubscribe'\n});\n\nvar c = compute(0);\n\nvar stream = canStream.toStream(c);\n\nvar computeVal;\n\nstream.subscribe((newVal) =\u003e {\n\tcomputeVal = newVal;\n});\n\nc(1);\n\nconsole.log(computeVal); //1\n```\n\n### Using Kefir\n\n```\nvar canStreamX = require('./can-stream-x');\nvar Kefir = require('kefir');\nvar canStream = canStreamX({\n  streamConstructor: Kefir.stream,\n  emitMethod: 'emit',\n  on: 'onValue',\n  off: 'offValue'\n});\n...\n```\n\n### Using Bacon\n\n```\nvar canStreamX = require('./can-stream-x');\nvar Bacon = require('bacon');\nvar canStream = canStreamX({\n  streamConstructor: Bacon.fromBinder,\n  on: 'onValue',\n  off: false\n});\n...\n```\n\n## testing\n\n```\nnpm test\n```","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fweb-mech%2Fcan-stream-x","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fweb-mech%2Fcan-stream-x","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fweb-mech%2Fcan-stream-x/lists"}