{"id":26347197,"url":"https://github.com/jtkdvlp/re-frame-worker-fx","last_synced_at":"2025-03-16T07:16:03.961Z","repository":{"id":57713767,"uuid":"83024181","full_name":"jtkDvlp/re-frame-worker-fx","owner":"jtkDvlp","description":"A re-frame \"effects handler\" for performing async tasks via cljs-workers","archived":false,"fork":false,"pushed_at":"2023-01-28T20:51:16.000Z","size":11,"stargazers_count":13,"open_issues_count":0,"forks_count":1,"subscribers_count":3,"default_branch":"master","last_synced_at":"2025-02-24T06:16:41.489Z","etag":null,"topics":["async","re-frame","thread","web-worker"],"latest_commit_sha":null,"homepage":"","language":"Clojure","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/jtkDvlp.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":"2017-02-24T09:21:35.000Z","updated_at":"2024-09-05T20:57:42.000Z","dependencies_parsed_at":"2023-02-15T18:46:26.907Z","dependency_job_id":null,"html_url":"https://github.com/jtkDvlp/re-frame-worker-fx","commit_stats":null,"previous_names":[],"tags_count":5,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/jtkDvlp%2Fre-frame-worker-fx","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/jtkDvlp%2Fre-frame-worker-fx/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/jtkDvlp%2Fre-frame-worker-fx/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/jtkDvlp%2Fre-frame-worker-fx/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/jtkDvlp","download_url":"https://codeload.github.com/jtkDvlp/re-frame-worker-fx/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":243835926,"owners_count":20355616,"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":["async","re-frame","thread","web-worker"],"created_at":"2025-03-16T07:16:03.133Z","updated_at":"2025-03-16T07:16:03.947Z","avatar_url":"https://github.com/jtkDvlp.png","language":"Clojure","funding_links":["https://www.paypal.com/donate?hosted_button_id=2PDXQMHX56T6U"],"categories":[],"sub_categories":[],"readme":"[![Clojars Project](https://img.shields.io/clojars/v/jtk-dvlp/re-frame-worker-fx.svg)](https://clojars.org/jtk-dvlp/re-frame-worker-fx)\n[![License: MIT](https://img.shields.io/badge/License-MIT-yellow.svg)](https://github.com/jtkDvlp/re-frame-worker-fx/blob/master/LICENSE)\n[![paypal](https://www.paypalobjects.com/en_US/i/btn/btn_donate_SM.gif)](https://www.paypal.com/donate?hosted_button_id=2PDXQMHX56T6U)\n\n# Web workers effect handler for re-frame\n\nThis [re-frame](https://github.com/Day8/re-frame) library contains an [web worker](https://developer.mozilla.org/docs/Web/API/Web_Workers_API/Using_web_workers) [effect handler](https://github.com/Day8/re-frame/tree/develop/docs). The handler can be addressed by `:worker` and wraps the API of [cljs-workers](https://github.com/jtkDvlp/cljs-workers).\n\n## Getting started\n\n### Get it / add dependency\n\nAdd the following dependency to your `project.cljs`:\u003cbr\u003e\n[![Clojars Project](https://img.shields.io/clojars/v/jtk-dvlp/re-frame-worker-fx.svg)](https://clojars.org/jtk-dvlp/re-frame-worker-fx)\n\n### Usage\n\nSee the following minimal code example or the [test.cljs](https://github.com/jtkDvlp/re-frame-worker-fx/blob/master/test/re_frame_worker_fx/test.cljs). For general usage of workers see [cljs-workers](https://github.com/jtkDvlp/cljs-workers).\n\nThe following example presupposes that there is already a worker pool and registered worker-handler.\n\n```clojure\n(ns your.project\n  (:require [re-frame.core :as re-frame]\n            [re-frame-worker-fx.core]))\n\n(re-frame/reg-event-fx\n :some-event\n (fn [coeffects _]\n   (let [worker-pool\n         (-\u003e coeffects :db :worker-pool)]\n     {:worker {:pool worker-pool\n               ;; handler that will be called\n               :handler :your-worker-handler\n               ;; arguments applied to the handler\n               :arguments {:a \"Hallo Welt!\" :b 10 :c (js/ArrayBuffer. 10)}\n               ;; which arguments will be transfered instead of copied\n               :transfer [:c]\n               ;; dispatched on success conjoined with the result\n               :on-success [:your-success-event]\n               ;; dispatched on error conjoined with the result\n               :on-error [:your-error-event]}})))\n```\n\n## Appendix\n\nI´d be thankful to receive patches, comments and constructive criticism.\n\nHope the package is useful :-)\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fjtkdvlp%2Fre-frame-worker-fx","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fjtkdvlp%2Fre-frame-worker-fx","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fjtkdvlp%2Fre-frame-worker-fx/lists"}