{"id":23626320,"url":"https://github.com/yetanalytics/sse-fx","last_synced_at":"2025-08-31T02:31:41.713Z","repository":{"id":62432107,"uuid":"125119525","full_name":"yetanalytics/sse-fx","owner":"yetanalytics","description":"re-frame FX and CoFX for working with EventSource connections in the browser","archived":false,"fork":false,"pushed_at":"2018-06-05T20:40:47.000Z","size":13,"stargazers_count":9,"open_issues_count":1,"forks_count":2,"subscribers_count":6,"default_branch":"master","last_synced_at":"2024-11-28T12:43:44.910Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"language":"Clojure","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"epl-1.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/yetanalytics.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":"2018-03-13T21:53:37.000Z","updated_at":"2021-04-16T21:01:07.000Z","dependencies_parsed_at":"2022-11-01T20:47:09.646Z","dependency_job_id":null,"html_url":"https://github.com/yetanalytics/sse-fx","commit_stats":null,"previous_names":[],"tags_count":1,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/yetanalytics%2Fsse-fx","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/yetanalytics%2Fsse-fx/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/yetanalytics%2Fsse-fx/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/yetanalytics%2Fsse-fx/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/yetanalytics","download_url":"https://codeload.github.com/yetanalytics/sse-fx/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":231548410,"owners_count":18393559,"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-12-27T22:52:56.758Z","updated_at":"2024-12-27T22:52:57.389Z","avatar_url":"https://github.com/yetanalytics.png","language":"Clojure","funding_links":[],"categories":[],"sub_categories":[],"readme":"# sse-fx\n\n`sse-fx` provides a set of [re-frame](https://github.com/Day8/re-frame) [fx](https://github.com/Day8/re-frame/blob/master/docs/Effects.md) and [cofx](https://github.com/Day8/re-frame/blob/master/docs/Coeffects.md) handlers for working with [EventSource](https://developer.mozilla.org/en-US/docs/Web/API/EventSource) objects and [Server-Sent Events](https://developer.mozilla.org/en-US/docs/Web/API/Server-sent_events).\n\n## Usage\n\n```clojure\n(ns re-frame-app.events\n  (:require [re-frame.core :as re-frame]\n            [com.yetanalytics.sse-fx.events :refer [register-all!]]\n            [com.yetanalytics.sse-fx.event-source :as event-source]\n            ))\n\n;; Register all fx/cofx\n(register-all!)\n\n;; Just the event source handlers\n;; (event-source/register!)\n\n;; Use one in a handler\n(re-frame/reg-event-fx\n ::init-event-source\n (fn [{:keys [db] :as ctx} _]\n   {::event-source/init\n    {:uri \"/query\"\n     ;; handle-* args are re-frame event handlers\n     :handle-open [::sse-open] ;; re-frame app handler to dispatch\n     ;; messages are transit-decoded by default\n     ;; supply your own with :decode-msg-fn\n     :handle-message [::sse-message]\n     ;; Errors can be actual EventSource errors, or handling/dispatch errors.\n     ;; either way, they're wrapped in an ex-info\n     :handle-error [::sse-error]\n     ;; This isn't an event, but rather fires when you close the EventSource with the ::event-source/close fx handler\n     :handle-close [::sse-close]}}))\n\n```\n## License\n\nCopyright © 2018 Yet Analytics Inc.\n\nDistributed under the Eclipse Public License either version 1.0 or (at\nyour option) any later version.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fyetanalytics%2Fsse-fx","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fyetanalytics%2Fsse-fx","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fyetanalytics%2Fsse-fx/lists"}