{"id":17134331,"url":"https://github.com/brianium/action","last_synced_at":"2025-03-24T06:16:30.561Z","repository":{"id":62431330,"uuid":"100985765","full_name":"brianium/action","owner":"brianium","description":"A dumb simple message format inspired by flux standard actions","archived":false,"fork":false,"pushed_at":"2017-08-21T19:37:55.000Z","size":3,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":2,"default_branch":"master","last_synced_at":"2025-03-18T05:56:26.446Z","etag":null,"topics":["clojure","clojurescript","flux"],"latest_commit_sha":null,"homepage":null,"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/brianium.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":"2017-08-21T19:32:48.000Z","updated_at":"2017-08-21T19:39:19.000Z","dependencies_parsed_at":"2022-11-01T20:46:33.676Z","dependency_job_id":null,"html_url":"https://github.com/brianium/action","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/brianium%2Faction","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/brianium%2Faction/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/brianium%2Faction/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/brianium%2Faction/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/brianium","download_url":"https://codeload.github.com/brianium/action/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":245217945,"owners_count":20579300,"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":["clojure","clojurescript","flux"],"created_at":"2024-10-14T19:44:38.366Z","updated_at":"2025-03-24T06:16:30.517Z","avatar_url":"https://github.com/brianium.png","language":"Clojure","funding_links":[],"categories":[],"sub_categories":[],"readme":"# action\n\n[![Clojars Project](https://img.shields.io/clojars/v/brianium/action.svg)](https://clojars.org/brianium/action)\n\nA simple message format modeled after [flux standard actions](https://github.com/acdlite/flux-standard-action).\n\nFor Clojure and ClojureScript.\n\n## Usage\n\nThe spec should sort out what an action is :)\n\n```clojure\n(s/def ::type keyword?)\n(s/def ::payload any?)\n(s/def ::error? boolean?)\n(s/def ::meta any?)\n(s/def ::action (s/keys :req-un [::type]\n                        :opt-un [::payload ::error? ::meta]))\n```\n\nAn example of an action:\n\n```clojure\n{:type    :create/user\n :error?  false\n :paylaod {:name \"Brian\" :title \"Computer\"}}\n```\n\nA couple of functions are bundled to facilitate use of this format.\n\n```clojure\n(require '[brianium.action :refer [make-action make-error]])\n\n(make-action :create/user {:name \"Brian\" :title \"Computer\"} false)\n;; =\u003e {:type :create/user\n       :payload {:name \"Brian\" :title \"Computer\"}\n\t   :error? false}\n\t\n(make-action :create/user {:name \"Brian\" :title \"Computer\"})\n;; =\u003e {:type :create/user\n       :payload {:name \"Brian\" :title \"Computer\"}\n\t   :error? false}\n\t   \n(make-action :cache-clear)\n;; =\u003e {:type :cache-clear\n       :payload {}\n\t   :error? false}\n\t   \n(make-error :create/user (ex-info \"User creation error\" {:reason \"email exists\"}))\n;; =\u003e {:type :create/user\n       :payload ,, (IExceptionInfo instance)\n\t   :error? true}\n```\n\n## Testing\n\n```\nlein test\n```\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fbrianium%2Faction","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fbrianium%2Faction","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fbrianium%2Faction/lists"}