{"id":21839333,"url":"https://github.com/darkleaf/multidecorators","last_synced_at":"2025-10-26T16:46:09.145Z","repository":{"id":62432229,"uuid":"194318544","full_name":"darkleaf/multidecorators","owner":"darkleaf","description":"Like multimethods but multidecorators.","archived":false,"fork":false,"pushed_at":"2020-02-19T18:58:43.000Z","size":12,"stargazers_count":11,"open_issues_count":2,"forks_count":0,"subscribers_count":2,"default_branch":"master","last_synced_at":"2025-03-27T23:51:06.281Z","etag":null,"topics":["aop","aspect-oriented-programming","clojure","clojurescript","decorator-pattern","inheritance","middlware","multimethods"],"latest_commit_sha":null,"homepage":"","language":"Clojure","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"unlicense","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/darkleaf.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE.txt","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2019-06-28T18:36:36.000Z","updated_at":"2022-04-05T21:01:38.000Z","dependencies_parsed_at":"2022-11-01T20:46:46.508Z","dependency_job_id":null,"html_url":"https://github.com/darkleaf/multidecorators","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/darkleaf%2Fmultidecorators","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/darkleaf%2Fmultidecorators/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/darkleaf%2Fmultidecorators/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/darkleaf%2Fmultidecorators/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/darkleaf","download_url":"https://codeload.github.com/darkleaf/multidecorators/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":248866294,"owners_count":21174517,"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":["aop","aspect-oriented-programming","clojure","clojurescript","decorator-pattern","inheritance","middlware","multimethods"],"created_at":"2024-11-27T21:17:14.218Z","updated_at":"2025-10-26T16:46:09.072Z","avatar_url":"https://github.com/darkleaf.png","language":"Clojure","readme":"[![Clojars Project](https://img.shields.io/clojars/v/darkleaf/multidecorators.svg)](https://clojars.org/darkleaf/multidecorators)\n\n# Multidecorators\n\nLike multimethods but multidecorators.\n\n+ clojure(script)\n+ dead simple\n+ no deps\n+ no macros\n\n\n## Usage\n\n```clojure\n(ns example\n  (:require\n   [darkleaf.multidecorators :as md]))\n\n;; diamond inheritance\n(derive ::d ::b)\n(derive ::d ::c)\n(derive ::b ::a)\n(derive ::c ::a)\n\n(defn dispatch [obj]\n  obj)\n\n(defn initial [obj]\n  [])\n\n(defonce func (md/multi #'dispatch #'initial))\n\n(md/decorate func ::a\n  (fn a-decorator [super obj]\n    (conj (super obj) :a)))\n\n(md/decorate func ::b\n  (fn b-decorator [super obj]\n    (conj (super obj) :b)))\n\n(md/decorate func ::c\n  (fn c-decorator [super obj]\n    (conj (super obj) :c)))\n\n(md/decorate func ::d\n  (fn d-decorator [super obj]\n    (conj (super obj) :d)))\n\n(md/decorate func ::e\n  (fn e-decorator [super obj]\n    (conj (super obj) :e)))\n\n(assert (= [:a] (func ::a)))\n(assert (= [:a :b] (func ::b)))\n(assert (= [:a :c] (func ::c)))\n(assert (= [:a :b :c :d] (func ::d)))\n(assert (= [:e] (func ::e)))\n(assert (= [] (func ::f)))\n```\n\n## Development\n\n```\nlein test\nlein doo node node-none once\nlein doo node node-advanced once\n```\n","funding_links":[],"categories":[],"sub_categories":[],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fdarkleaf%2Fmultidecorators","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fdarkleaf%2Fmultidecorators","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fdarkleaf%2Fmultidecorators/lists"}