{"id":15694288,"url":"https://github.com/snugug/data-state","last_synced_at":"2025-05-07T05:22:02.333Z","repository":{"id":19711394,"uuid":"22966783","full_name":"Snugug/Data-State","owner":"Snugug","description":"Small JavaScript helper for working with the `data-state` attribute of an element","archived":false,"fork":false,"pushed_at":"2014-08-23T02:30:35.000Z","size":216,"stargazers_count":7,"open_issues_count":0,"forks_count":1,"subscribers_count":2,"default_branch":"master","last_synced_at":"2025-04-14T16:07:46.503Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":"","language":"JavaScript","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":"apache/kafka","license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/Snugug.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":"2014-08-14T19:57:12.000Z","updated_at":"2018-02-24T23:54:11.000Z","dependencies_parsed_at":"2022-08-24T10:40:08.133Z","dependency_job_id":null,"html_url":"https://github.com/Snugug/Data-State","commit_stats":null,"previous_names":[],"tags_count":5,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Snugug%2FData-State","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Snugug%2FData-State/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Snugug%2FData-State/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Snugug%2FData-State/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/Snugug","download_url":"https://codeload.github.com/Snugug/Data-State/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":252819050,"owners_count":21808964,"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-10-03T18:55:53.943Z","updated_at":"2025-05-07T05:22:02.302Z","avatar_url":"https://github.com/Snugug.png","language":"JavaScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"Data-State\n==========\n\nSmall JavaScript helper for setting the `data-state` attribute of an element\n\n\n## Installation\n\nData State can be installed via Bower\n\n```bash\n$ bower install data-state --save\n```\n\nIt will either present itself as the global `state` variable or be available via `define`/`module.exports`, depending on what's available.\n\n## Usage\n\n* `state.get(el)` - Returns an array of states for the given element `el`, or `null` if it has no states\n* `state.has(el, has)` - Returns `true` if the element `el` has the given state `has`\n* `state.add(el, add)` - Adds the state `add` to the element `el`. If a state gets added that already exists, will not be added twice\n* `state.set(el, add)` Same as `state.add`\n* `state.remove(el, remove)` - Removes the state `state` from the element `el`. If multiple states present, will only remove the given state. If the last state gets removed, the `data-state` attribute will be removed\n* `state.toggle(el, toggle)` - Removes the state `toggle` from the element `el` using `state.remove`, if it exists, otherwise adds it using `state.add`\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fsnugug%2Fdata-state","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fsnugug%2Fdata-state","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fsnugug%2Fdata-state/lists"}