{"id":17041825,"url":"https://github.com/bodil/purescript-observable","last_synced_at":"2026-01-05T04:54:02.777Z","repository":{"id":58231144,"uuid":"49438631","full_name":"bodil/purescript-observable","owner":"bodil","description":"ES7 Observables for PureScript","archived":false,"fork":false,"pushed_at":"2017-03-09T21:49:00.000Z","size":36,"stargazers_count":29,"open_issues_count":1,"forks_count":1,"subscribers_count":6,"default_branch":"master","last_synced_at":"2024-04-15T12:19:16.376Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":"","language":"PureScript","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/bodil.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":null,"code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2016-01-11T16:24:35.000Z","updated_at":"2022-10-16T23:54:05.000Z","dependencies_parsed_at":"2022-08-30T20:01:38.659Z","dependency_job_id":null,"html_url":"https://github.com/bodil/purescript-observable","commit_stats":null,"previous_names":[],"tags_count":9,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/bodil%2Fpurescript-observable","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/bodil%2Fpurescript-observable/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/bodil%2Fpurescript-observable/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/bodil%2Fpurescript-observable/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/bodil","download_url":"https://codeload.github.com/bodil/purescript-observable/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":245042695,"owners_count":20551642,"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-14T09:13:42.114Z","updated_at":"2026-01-05T04:54:02.744Z","avatar_url":"https://github.com/bodil.png","language":"PureScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"# purescript-observable\n\nObservables for PureScript, compatible with the\n[ECMAScript Observable proposal](https://github.com/zenparsing/es-observable).\n\n* [API docs on Pursuit](http://pursuit.purescript.org/packages/purescript-observable/)\n\n## Usage\n\nA basic usage example:\n\n```purescript\nmodule Main where\n\nimport Prelude\nimport Control.Monad.Eff.Console (log)\nimport Control.Monad.Eff.Exception (message)\nimport Control.Observable (fromFoldable, subscribe)\nimport Data.String (toUpper)\n\nmain = do\n  let o = toUpper \u003c$\u003e fromFoldable [\"hello\", \"world\"]\n  subscribe {\n    next: log,\n    error: message \u003e\u003e\u003e log,\n    complete: pure unit\n    } o\n```\n\nCreating custom streams:\n\n```purescript\nmodule Main where\n\nimport Prelude\nimport Control.Monad.Eff.Console (log)\nimport Control.Monad.Eff.Exception (message)\nimport Control.Observable (observable, subscribe, free)\n\nmain = do\n  o \u003c- observable \\sink -\u003e do\n    sink.next \"Hello Joe\"\n    sink.next \"Hello Mike\"\n    sink.next \"Hello Robert\"\n    sink.complete\n    free []\n\n  -- `observe` is a shorthand for `subscribe`\n  observe log (message \u003e\u003e\u003e log) (pure unit) o\n```\n\n## ECMAScript Observable Compatibility\n\nThe observables created by this library should be fully compatible\nwith the\n[ECMAScript Observable proposal](https://github.com/zenparsing/es-observable).\nYou should also be able to consume any observable implementing the\nspecification using this library, if you cast it to the `Observable`\ntype.\n\n## FAQ\n\nQ: Why isn't every operation effectful?\n\nA: Only operations which may need to utilise effects themselves are\neffectful. This includes creating new observables, subscribing to an\nobservable, and not much else. Creating a new observable by eg.\nmapping a pure function over an existing observable is itself a pure\nfunction - it's true that if you perform such an operation twice\nyou'll have two different observables, but they'll always emit the\nexact same events at the exact same time, meaning that they have value\nequality.\n\n## Licence\n\nCopyright 2016 Bodil Stokke\n\nThis program is free software: you can redistribute it and/or modify\nit under the terms of the GNU Lesser General Public License as\npublished by the Free Software Foundation, either version 3 of the\nLicense, or (at your option) any later version.\n\nThis program is distributed in the hope that it will be useful, but\nWITHOUT ANY WARRANTY; without even the implied warranty of\nMERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU\nLesser General Public License for more details.\n\nYou should have received a copy of the GNU Lesser General Public\nLicense along with this program. If not, see\n\u003chttp://www.gnu.org/licenses/\u003e.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fbodil%2Fpurescript-observable","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fbodil%2Fpurescript-observable","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fbodil%2Fpurescript-observable/lists"}