{"id":15046487,"url":"https://github.com/noxecane/irinse","last_synced_at":"2026-04-26T20:31:27.012Z","repository":{"id":62435014,"uuid":"90315400","full_name":"noxecane/irinse","owner":"noxecane","description":"A collection of components built using reagent and beicon and bulma","archived":false,"fork":false,"pushed_at":"2017-05-16T18:41:01.000Z","size":59,"stargazers_count":3,"open_issues_count":0,"forks_count":0,"subscribers_count":2,"default_branch":"master","last_synced_at":"2026-03-06T03:34:34.622Z","etag":null,"topics":["bulma","clojurescript","cyclejs","frontend-components","reactive-streams","reagent","rxjs"],"latest_commit_sha":null,"homepage":"https://tsaron.github.io/irinse/","language":"Clojure","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"gpl-3.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/noxecane.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-05-04T22:31:59.000Z","updated_at":"2023-03-05T03:10:06.000Z","dependencies_parsed_at":"2022-11-01T21:02:35.468Z","dependency_job_id":null,"html_url":"https://github.com/noxecane/irinse","commit_stats":null,"previous_names":["tsaron/irinse","tsaron/components"],"tags_count":2,"template":false,"template_full_name":null,"purl":"pkg:github/noxecane/irinse","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/noxecane%2Firinse","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/noxecane%2Firinse/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/noxecane%2Firinse/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/noxecane%2Firinse/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/noxecane","download_url":"https://codeload.github.com/noxecane/irinse/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/noxecane%2Firinse/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":32312190,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-04-26T19:15:34.056Z","status":"ssl_error","status_checked_at":"2026-04-26T19:15:15.467Z","response_time":129,"last_error":"SSL_read: unexpected eof while reading","robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":false,"can_crawl_api":true,"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":["bulma","clojurescript","cyclejs","frontend-components","reactive-streams","reagent","rxjs"],"created_at":"2024-09-24T20:53:09.831Z","updated_at":"2026-04-26T20:31:26.995Z","avatar_url":"https://github.com/noxecane.png","language":"Clojure","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Irinse\n\n## Introduction\n`irinse` is a collection of simple reagent components.\n\n## Install\nThe simplest way to use `irinse` in a clojurescript project, is by including it in the dependency vector on your project.clj file:\n\n[![Clojars Project](https://img.shields.io/clojars/v/tsaron/irinse.svg)](https://clojars.org/tsaron/irinse)\n\n\n## Events\n\n### Creating event streams\nTo listen to events from a reagent component, you'll need to create a subject. The subject acts like a function so you can call it's next method.\n\n```clojure\n(require '[beicon.core :as rx]\n         '[irinse.beiconx :as rxt]) ;; import beiconx as subjects can be used as functions\n\n(let [v (rx/subject)\n      _ (rxt/log \"Value\" v)]\n    (v 1) ;; ==\u003e Value: 1\n    (v [1 2]) ;; ==\u003e Value: [1 2]\n    (v)) ;; end\n```\n\n\n### Converting streams to state\nWe could use reagent atoms to store the values from streams mainly because reagent itself does not work with reactive streams.\n\n```clojure\n(def name-stream (rx/subject))\n\n(def name (rxt/to-ratom \"\" name-stream))\n\n@name \n;; ==\u003e \"\"\n\n(name-stream \"noxecane\")\n(name-stream \"Obasanjo\")\n \n@name\n;; ==\u003e \"Obasanjo\"\n```\n\nOne could also reduce over the state\n```clojure\n(def fill-list (rx/subject))\n(def ilist (rxt/to-ratom [] conj fill-list))\n\n(fill-list 12)\n(fill-list 13)\n(fill-list 14)\n\n@ilist\n;; ==\u003e [12 13 14]\n```\n\n### Converting a channel to an observable\nThere is an equivalent function to `from-promise` for **core.async** channels. Bear in mind that buffers don't matter\nas this function eagerly consume new events from the channel and dispatches them regardless of availability of\nsubscribers. Hence, more like subjects, only events received after subscription matter. \n```clojure\n(require '[cljs.core.async :as a])\n\n(def b (a/chan 1))\n\n(def c (rxt/from-chan a))\n(rxt/log \"From Channel\" c)\n\n(a/put! b 10)\n;; ==\u003e From Channel: 10\n```\n\n### Creating Simple forms\nFor instance to create a login form component\n```clojure\n(require '[irinse.forms :as form])\n\n(defn model [{:keys [login-service]}]\n  (let [write  (rx/subject)\n        submit (rx/subject)\n        state  (form/writes write) ;; reduce write events over a map [:name :value]\n        login  (rx/flat-map  submit)] ;\n    {:write  write\n     :submit submit\n     :state  state}))\n\n(defn view [{:keys [write submit state]}]\n  (fn []\n    [:form\n      [:input.input {:type      \"text\"\n                     :on-change (form/input write [:username])}]\n      [:input.input {:type      \"password\"\n                     :on-change (form/input write [:password])}]\n      [:button.button {:type     \"button\"\n                       :on-click #(submit @state)}]]))\n```\n\n## License\n\n`irinse` is licensed under GPLv3 license:\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fnoxecane%2Firinse","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fnoxecane%2Firinse","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fnoxecane%2Firinse/lists"}