{"id":13826404,"url":"https://github.com/WebReflection/dom-augmentor","last_synced_at":"2025-07-09T00:33:15.143Z","repository":{"id":65993160,"uuid":"165375604","full_name":"WebReflection/dom-augmentor","owner":"WebReflection","description":"Same as augmentor but with DOM oriented useEffect handling via dropEffect.","archived":false,"fork":false,"pushed_at":"2020-05-31T00:48:14.000Z","size":109,"stargazers_count":59,"open_issues_count":5,"forks_count":2,"subscribers_count":4,"default_branch":"master","last_synced_at":"2024-11-15T21:14:11.798Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":"","language":"JavaScript","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"isc","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/WebReflection.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,"governance":null,"roadmap":null,"authors":null}},"created_at":"2019-01-12T10:35:44.000Z","updated_at":"2024-09-02T13:15:02.000Z","dependencies_parsed_at":"2023-05-21T17:00:31.107Z","dependency_job_id":null,"html_url":"https://github.com/WebReflection/dom-augmentor","commit_stats":null,"previous_names":[],"tags_count":43,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/WebReflection%2Fdom-augmentor","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/WebReflection%2Fdom-augmentor/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/WebReflection%2Fdom-augmentor/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/WebReflection%2Fdom-augmentor/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/WebReflection","download_url":"https://codeload.github.com/WebReflection/dom-augmentor/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":225476383,"owners_count":17480215,"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":[],"created_at":"2024-08-04T09:01:36.872Z","updated_at":"2024-11-20T05:30:41.471Z","avatar_url":"https://github.com/WebReflection.png","language":"JavaScript","readme":"# dom-augmentor\n\n[![Build Status](https://travis-ci.com/WebReflection/dom-augmentor.svg?branch=master)](https://travis-ci.com/WebReflection/dom-augmentor) [![Coverage Status](https://coveralls.io/repos/github/WebReflection/dom-augmentor/badge.svg?branch=master)](https://coveralls.io/github/WebReflection/dom-augmentor?branch=master) [![Greenkeeper badge](https://badges.greenkeeper.io/WebReflection/dom-augmentor.svg)](https://greenkeeper.io/) ![WebReflection status](https://offline.report/status/webreflection.svg)\n\n\u003csup\u003e**Social Media Photo by [stephan sorkin](https://unsplash.com/@sorkin) on [Unsplash](https://unsplash.com/)**\u003c/sup\u003e\n\nThis is exactly the same as the [augmentor](https://github.com/WebReflection/augmentor) module, except it handles automatically effects per DOM nodes.\n\nCompatible with any function that returns a DOM node, or a fragment, or a hyperhtml like Wire instance.\n\n\n\n### Breaking in v1\n\n  * the default export has been removed, it's `import {augmentor} from 'augmentor'` now\n  * the `augmentor` library is the v1 one\n  * effects now work more reliably and there are no constrains for the guards\n\n\n\n### Example\n\n**[Live Demo](https://codepen.io/WebReflection/pen/maQXwq)**\n\n```js\nconst {augmentor: $, useEffect, useRef, useState} = augmentor;\nconst {render, hook} = lighterhtml;\nconst {html, svg} = hook(useRef);\n\nconst Button = (text) =\u003e $(() =\u003e {\n  useEffect(\n    () =\u003e {\n      console.log('connected');\n      return () =\u003e console.log('disconnected');\n    },\n    []\n  );\n  const [i, increment] = useState(0);\n  return html`\n  \u003cbutton onclick=${() =\u003e increment(i + 1)}\u003e\n    ${text} ${i}\n  \u003c/button\u003e`;\n});\n\nconst button = Button('hello');\n\nrender(document.body, button);\n// alternatively\n// document.body.appendChild(button());\n```\n","funding_links":[],"categories":["JavaScript"],"sub_categories":[],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2FWebReflection%2Fdom-augmentor","html_url":"https://awesome.ecosyste.ms/projects/github.com%2FWebReflection%2Fdom-augmentor","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2FWebReflection%2Fdom-augmentor/lists"}