{"id":43119638,"url":"https://github.com/s1owjke/lit-element-context","last_synced_at":"2026-01-31T19:11:18.203Z","repository":{"id":57290356,"uuid":"319613848","full_name":"s1owjke/lit-element-context","owner":"s1owjke","description":"Context for lit-element components","archived":false,"fork":false,"pushed_at":"2024-05-17T15:59:22.000Z","size":332,"stargazers_count":1,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"master","last_synced_at":"2025-10-14T07:25:54.878Z","etag":null,"topics":["context","lit","lit-element","mixin","web-components","webcomponents"],"latest_commit_sha":null,"homepage":"","language":"TypeScript","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/s1owjke.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,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2020-12-08T11:10:49.000Z","updated_at":"2024-05-25T16:25:22.000Z","dependencies_parsed_at":"2024-05-17T16:37:38.176Z","dependency_job_id":"d71df56e-3bac-4973-a90d-8eb388801dc3","html_url":"https://github.com/s1owjke/lit-element-context","commit_stats":{"total_commits":10,"total_committers":2,"mean_commits":5.0,"dds":0.09999999999999998,"last_synced_commit":"613170a64e2d531609ebbff029d950440712a63f"},"previous_names":[],"tags_count":6,"template":false,"template_full_name":null,"purl":"pkg:github/s1owjke/lit-element-context","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/s1owjke%2Flit-element-context","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/s1owjke%2Flit-element-context/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/s1owjke%2Flit-element-context/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/s1owjke%2Flit-element-context/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/s1owjke","download_url":"https://codeload.github.com/s1owjke/lit-element-context/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/s1owjke%2Flit-element-context/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":28950628,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-01-31T18:30:42.805Z","status":"ssl_error","status_checked_at":"2026-01-31T18:30:19.593Z","response_time":128,"last_error":"SSL_connect returned=1 errno=0 peeraddr=140.82.121.6:443 state=error: unexpected eof while reading","robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":false,"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":["context","lit","lit-element","mixin","web-components","webcomponents"],"created_at":"2026-01-31T19:11:17.639Z","updated_at":"2026-01-31T19:11:18.198Z","avatar_url":"https://github.com/s1owjke.png","language":"TypeScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"# LitElement Context\n\n[![Published on npm](https://img.shields.io/npm/v/lit-element-context?color=brightgreen)](https://www.npmjs.com/package/lit-element-context) [![License: MIT](https://img.shields.io/badge/License-MIT-blue.svg)](https://opensource.org/licenses/MIT)\n\nA set of [class mixin functions](https://alligator.io/js/class-composition/#composition-with-javascript-classes) to provide and inject multiple contexts for lit-element, doesn't require any extra components for that.\n\n## Install\n\nUsing NPM:\n\n```shell\nnpm install lit-element-context\n```\n\nUsing YARN:\n\n```shell\nyarn add lit-element-context\n```\n\n## Usage\n\nAn example app also available on [codesandbox](https://codesandbox.io/s/lit-element-context-demo-i7f8u?file=/src/app.js)\n\n```javascript\nimport { LitElement, html } from \"lit\";\nimport { ProviderMixin, ConsumerMixin } from \"lit-element-context\";\n\nclass App extends ProviderMixin(LitElement) {\n  constructor() {\n    super();\n\n    this.name = \"hello\";\n    this.setName = (value) =\u003e {\n      this.name = value;\n    };\n  }\n\n  // provided values must be specified as properties to keep them updated\n  static get properties() {\n    return {\n      name: String,\n      setName: Function,\n    };\n  }\n\n  // specify which properties will be available in the context\n  static get provide() {\n    return [\"name\", \"setName\"];\n  }\n\n  render() {\n    return html`\n      \u003cdiv\u003e\n        \u003ch1\u003eLit-element context\u003c/h1\u003e\n        \u003cp\u003eCurrent name: ${this.name}\u003c/p\u003e\n        \u003cinput-component\u003e\u003c/input-component\u003e\n      \u003c/div\u003e\n    `;\n  }\n}\n\nclass Input extends ConsumerMixin(LitElement) {\n  static get properties() {\n    return {\n      name: String,\n      setName: Function,\n    };\n  }\n\n  // inject properties that we need from context\n  static get inject() {\n    return [\"name\", \"setName\"];\n  }\n\n  render() {\n    return html`\n      \u003cdiv\u003e\n        \u003clabel\u003eName:\u003c/label\u003e\n        \u003cinput .value=${this.name} @input=${(event) =\u003e this.setName(event.target.value)} /\u003e\n      \u003c/div\u003e\n    `;\n  }\n}\n```\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fs1owjke%2Flit-element-context","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fs1owjke%2Flit-element-context","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fs1owjke%2Flit-element-context/lists"}