{"id":15656819,"url":"https://github.com/flexsurfer/re-frame-steroid","last_synced_at":"2025-10-22T10:48:57.985Z","repository":{"id":62434377,"uuid":"239515539","full_name":"flexsurfer/re-frame-steroid","owner":"flexsurfer","description":"A Clojure library with a few functions-steroids for re-frame app","archived":false,"fork":false,"pushed_at":"2020-02-10T14:29:26.000Z","size":7,"stargazers_count":27,"open_issues_count":1,"forks_count":2,"subscribers_count":1,"default_branch":"master","last_synced_at":"2025-05-04T05:52:48.367Z","etag":null,"topics":["clojurescript","re-frame","reagent"],"latest_commit_sha":null,"homepage":"","language":"Clojure","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/flexsurfer.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":"2020-02-10T13:14:38.000Z","updated_at":"2024-10-27T08:11:00.000Z","dependencies_parsed_at":"2022-11-01T21:02:20.029Z","dependency_job_id":null,"html_url":"https://github.com/flexsurfer/re-frame-steroid","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/flexsurfer%2Fre-frame-steroid","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/flexsurfer%2Fre-frame-steroid/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/flexsurfer%2Fre-frame-steroid/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/flexsurfer%2Fre-frame-steroid/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/flexsurfer","download_url":"https://codeload.github.com/flexsurfer/re-frame-steroid/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":252293138,"owners_count":21724962,"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":["clojurescript","re-frame","reagent"],"created_at":"2024-10-03T13:04:29.148Z","updated_at":"2025-10-22T10:48:52.930Z","avatar_url":"https://github.com/flexsurfer.png","language":"Clojure","funding_links":[],"categories":[],"sub_categories":[],"readme":"# re-frame-steroid\n\nA Clojure library with a few functions-steroids for re-frame app\n\n[![Clojars](https://img.shields.io/clojars/v/re-frame-steroid.svg)](https://clojars.org/re-frame-steroid)\n\n## Usage\n\nViews\n\n```clojure\n(:require [steroid.views :as views]))\n\n(views/defview test-view []\n  (views/letsubs [subs1 [:subs1]\n                  subs2 [:subs2]]\n    [text (str subs1 \" wut \" subs2)]))\n```\n\n```clojure\n(views/defview test-view []\n  (views/letsubs [subs1 [:subs1]]\n    {:component-did-mount #(dosmth)}\n    [text subs1]))\n```\n\nEvents\n\n```clojure\n(:require [steroid.fx :as fx])\n\n(fx/defn update-count\n  {:events [:update-count]\n   :interceptors [(re-frame/inject-cofx :now)]}\n  [{:keys [db now]}]\n  {:db (-\u003e db\n           (update :count inc)\n           (assoc :now now))}) \n\n(fx/defn update-label\n  {:events [:update-label]}\n  [{:keys [db]} value]\n  {:db (assoc db :label value)})\n```\n\nMerge events\n\n```clojure\n(fx/defn update-count-and-label\n  {:events [:update-count-and-label]\n   :interceptors [(re-frame/inject-cofx :now)]}\n  [cofx label]\n  (fx/merge cofx\n            (update-count)\n            (update-label label)))\n```\n\n```clojure\n(re-frame/dispatch [:update-count-and-label \"label\"])\n```\n\n\nGlobal interceptors\n```clojure\n(def debug-handlers-names\n  \"Interceptor which logs debug information to js/console for each event.\"\n  (-\u003einterceptor\n   :id     :debug-handlers-names\n   :before (fn debug-handlers-names-before [context]\n             (log/debug \"Handling re-frame event: \" (pretty-print-event context))\n             context)))\n\n(fx/set-default-interceptors [debug-handlers-names])\n```\n\nSet mergeable keys\n```clojure\n(fx/set-mergeable-keys #{:key1 :key2})\n```\n\nSubs\n```clojure\n(:require [steroid.subs :as subs])\n\n(subs/reg-root-subs #{:sub1 :sub2})\n\n(subs/reg-root-sub :sub3)\n\n(subs/reg-root-sub :sub4-name :sub4)\n```\n\n\nENJOY!","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fflexsurfer%2Fre-frame-steroid","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fflexsurfer%2Fre-frame-steroid","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fflexsurfer%2Fre-frame-steroid/lists"}