{"id":23745089,"url":"https://github.com/cedmandocdoc/agos","last_synced_at":"2025-09-04T19:32:20.716Z","repository":{"id":42174597,"uuid":"218918015","full_name":"cedmandocdoc/agos","owner":"cedmandocdoc","description":"JavaScript utility for data flow composition","archived":false,"fork":false,"pushed_at":"2023-01-07T04:23:54.000Z","size":497,"stargazers_count":8,"open_issues_count":9,"forks_count":0,"subscribers_count":2,"default_branch":"master","last_synced_at":"2024-12-23T20:08:07.352Z","etag":null,"topics":["controllable-observable","controllable-stream","data-flow","functional","observable","reactive","stream"],"latest_commit_sha":null,"homepage":"","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/cedmandocdoc.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":"2019-11-01T05:19:34.000Z","updated_at":"2022-01-26T00:20:52.000Z","dependencies_parsed_at":"2023-02-06T11:46:12.009Z","dependency_job_id":null,"html_url":"https://github.com/cedmandocdoc/agos","commit_stats":null,"previous_names":[],"tags_count":28,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/cedmandocdoc%2Fagos","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/cedmandocdoc%2Fagos/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/cedmandocdoc%2Fagos/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/cedmandocdoc%2Fagos/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/cedmandocdoc","download_url":"https://codeload.github.com/cedmandocdoc/agos/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":231987770,"owners_count":18456475,"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":["controllable-observable","controllable-stream","data-flow","functional","observable","reactive","stream"],"created_at":"2024-12-31T12:53:21.743Z","updated_at":"2024-12-31T12:53:22.399Z","avatar_url":"https://github.com/cedmandocdoc.png","language":"JavaScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Agos\n\nJavaScript utility for data flow composition.\n\n## Overview\n\nAgos `(Filipino translation of Stream)` is a utility library that helps the data flow to be composed in a functional manner. It is inspired by other reactive libraries like RxJS, xstream and mostjs but with one key difference, the data source is naturally interactive. The general idea of the library is base on the article [Redefining Observarble](https://github.com/cedmandocdoc/redefining-observable), basically, it enables the data source to be reactive with an outside entity like an observer. It is also implements [Fantasy Land](https://github.com/fantasyland/fantasy-land) `Semigroup`, `Monoid`, `Functor`, `Apply`, `Applicative`, `Chain`, `Monad` and has interoperability in [Observable](https://github.com/tc39/proposal-observable).\n\n## Installation\n\nInstall it using [npm](https://www.npmjs.com/package/agos) or [yarn](https://yarnpkg.com/package/agos).\n\n```bash\nnpm install agos\n```\n\n## Example\n\n```js\nimport Stream, { pipe, create, filter, listen } from \"agos\";\n\n// create main source\nconst interval = create((open, next, fail, done, talkback) =\u003e {\n  let count = 0;\n  // propagate data\n  const id = setInterval(() =\u003e next(++count), 100);\n\n  // talkback is another stream that comes\n  // from the outside this enable the main\n  // source to be reactive on cancellation\n  // or anything depending on the implementaion,\n  // see that this piped stream filters only data\n  // that pertains to Stream cancellation stopping\n  // the data propagation\n  pipe(\n    talkback,\n    filter(data =\u003e data === Stream.CANCEL),\n    listen(() =\u003e {\n      clearInterval(id);\n      done(true)\n    })\n  )\n  open();\n});\n\n// create cancel source\nconst cancel = create((open, next, fail, done) =\u003e {\n  open();\n  setTimeout(() =\u003e {\n    // propagates CANCEL\n    next(Stream.CANCEL);\n    done(false);\n  }, 500);\n});\n\n// listen to main source and \n// passing the cancel source to\n// listen function\npipe(\n  interval,\n  listen({\n    open: () =\u003e console.log(\"open\"),\n    next: value =\u003e console.log(value),\n    fail: error =\u003e console.log(error),\n    done: cancelled =\u003e console.log(\"done\", \"cancelled\", cancelled),\n  }, cancel)\n);\n\n// logs\n// open\n// 1\n// 2\n// 3\n// 4\n// done cancelled true\n```\n\n## License\n\nThis project is licensed under the MIT License - see the [LICENSE](https://github.com/cedmandocdoc/agos/blob/master/LICENSE) file for details.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fcedmandocdoc%2Fagos","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fcedmandocdoc%2Fagos","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fcedmandocdoc%2Fagos/lists"}