{"id":19190413,"url":"https://github.com/mdxprograms/mycelia","last_synced_at":"2026-07-01T00:31:54.251Z","repository":{"id":161760717,"uuid":"529669489","full_name":"mdxprograms/mycelia","owner":"mdxprograms","description":"A minimal, DOM manipulation library with JavaScript functions as elements and a universal dispatching system","archived":false,"fork":false,"pushed_at":"2023-05-08T17:55:12.000Z","size":355,"stargazers_count":1,"open_issues_count":3,"forks_count":0,"subscribers_count":1,"default_branch":"main","last_synced_at":"2025-09-09T09:45:18.473Z","etag":null,"topics":["dom","javascript","typescript"],"latest_commit_sha":null,"homepage":"","language":"TypeScript","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/mdxprograms.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,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2022-08-27T18:44:06.000Z","updated_at":"2023-06-22T21:59:12.000Z","dependencies_parsed_at":null,"dependency_job_id":"076b4064-09df-48e0-bce8-588f6d56ed9f","html_url":"https://github.com/mdxprograms/mycelia","commit_stats":null,"previous_names":[],"tags_count":6,"template":false,"template_full_name":null,"purl":"pkg:github/mdxprograms/mycelia","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/mdxprograms%2Fmycelia","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/mdxprograms%2Fmycelia/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/mdxprograms%2Fmycelia/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/mdxprograms%2Fmycelia/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/mdxprograms","download_url":"https://codeload.github.com/mdxprograms/mycelia/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/mdxprograms%2Fmycelia/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":34988712,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-05-26T15:22:16.424Z","status":"online","status_checked_at":"2026-06-30T02:00:05.919Z","response_time":92,"last_error":null,"robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":true,"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":["dom","javascript","typescript"],"created_at":"2024-11-09T11:34:10.308Z","updated_at":"2026-07-01T00:31:54.221Z","avatar_url":"https://github.com/mdxprograms.png","language":"TypeScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"# mycelia\n\n```\nA minimal, DOM manipulation library with Javascript functions as elements and a universal dispatching system\n```\n\nThis is a continuation/improvement/evolution from [mantle](https://github.com/mdxprograms/mantle)\n\n## Installation\n\n```\nnpm i -S @wallerbuilt/mycelia\n```\n\n## Basic Usage\n\n```typescript\nimport { mount, dom } from \"@wallerbuilt/mycelia\";\n\n// Main element to mount the mycelia app to\nconst appSelector = \"#app\"\n\n// abstracting the div and h1 element from dom object (could also use it as `dom.div` and `dom.h1`)\nconst { div, h1 } = dom;\n\nconst Heading = h1({ classname: 'intro-heading' }, \"Hello mycelia!\");\n\n// Children are an array of mycelia elements or non-array strings\nconst App = div({ classname: 'app-container' }, [Heading])\n\n// mount our App to appSelector element\nmount(App, appSelector);\n```\n\n## Elements\n\nElements are created from the `dom` object.\n\n```typescript\nimport { dom } from \"@wallerbuilt/mycelia\";\n\nconst { div, button, p } = dom;\n\nconst Item = div({ className: \"item\" }, [\n\tp(\"I have some interesting things to say in this item's paragraph.\"),\n\tbutton({ onclick: console.log }, \"Click me!\")\n]);\n```\n\n## Mount\n\n`mount` is the jumping off point of your application and typically takes the outermost element as an argument.\n\n```typescript\nimport { mount, dom } from \"@wallerbuilt/mycelia\";\n\nconst appSelector = \"#app\";\n\nconst App = dom.div(\"the app here\")\n\nmount(App, appSelector);\n```\n\n## Events and Dispatch\n\n```typescript\nimport { Emitter } from \"@wallerbuilt/mycelia\";\n\ntype State = {\n  todos: string[];\n}\n\nconst emit = new Emitter\u003cState\u003e(); // the generic is then passed to `on` and `dispatch` on instantiation\n```\n\nWhen using `emit.on` or `emit.dispatch`, your payload returned and sent (respectively), requires that type of state object to be passed.\n\n```typescript\nemit.on(\"event:name\")(({ todos }) =\u003e console.log(todos));\n\nemit.dispatch(\"event:name\")({ todos: [\"one added\"] });\n```","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fmdxprograms%2Fmycelia","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fmdxprograms%2Fmycelia","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fmdxprograms%2Fmycelia/lists"}