{"id":19152319,"url":"https://github.com/nanostores/lit","last_synced_at":"2025-05-09T00:09:14.889Z","repository":{"id":92271660,"uuid":"591742941","full_name":"nanostores/lit","owner":"nanostores","description":"Lit integration for Nano Stores, a tiny state manager with many atomic tree-shakable stores","archived":false,"fork":false,"pushed_at":"2024-08-15T13:39:20.000Z","size":887,"stargazers_count":34,"open_issues_count":3,"forks_count":3,"subscribers_count":4,"default_branch":"main","last_synced_at":"2025-03-31T19:44:07.556Z","etag":null,"topics":["lit","state","state-management","store"],"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/nanostores.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":"2023-01-21T18:14:32.000Z","updated_at":"2025-03-15T09:48:22.000Z","dependencies_parsed_at":"2024-11-09T08:27:48.340Z","dependency_job_id":null,"html_url":"https://github.com/nanostores/lit","commit_stats":null,"previous_names":[],"tags_count":8,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/nanostores%2Flit","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/nanostores%2Flit/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/nanostores%2Flit/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/nanostores%2Flit/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/nanostores","download_url":"https://codeload.github.com/nanostores/lit/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":252839353,"owners_count":21812092,"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":["lit","state","state-management","store"],"created_at":"2024-11-09T08:17:26.705Z","updated_at":"2025-05-09T00:09:14.847Z","avatar_url":"https://github.com/nanostores.png","language":"TypeScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Nano Stores Lit\n\n\u003cimg align=\"right\" width=\"92\" height=\"92\" title=\"Nano Stores logo\"\n     src=\"https://nanostores.github.io/nanostores/logo.svg\"\u003e\n\n[Lit](https://lit.dev/) integration for **[Nano Stores]**, a tiny state manager\nwith many atomic tree-shakable stores.\n\n- **Small.** Less than 1 KB. Zero dependencies.\n- **Fast.** With small atomic and derived stores, you do not need to call\n  the selector function for all components on every store change.\n- **Tree Shakable.** The chunk contains only stores used by components\n  in the chunk.\n- Was designed to move logic from components to stores.\n- It has good **TypeScript** support.\n\n## Quick start\n\nInstall it:\n\n```bash\nnpm add nanostores @nanostores/lit # or yarn\n```\n\nUse it as a decorator with `@useStores`:\n\n```ts\nimport { LitElement, html } from \"lit\";\nimport { customElement } from \"lit/decorators.js\";\nimport { useStores } from \"@nanostores/lit\";\n\nimport { profile } from \"./stores/profile.js\";\n\n@customElement(\"my-header\")\n@useStores(profile)\nclass MyHeader extends LitElement {\n  render() {\n    return html`\u003cheader\u003e${profile.get().userId}\u003c/header\u003e`;\n  }\n}\n```\n\nOr as a mixin with `withStores`:\n\n```ts\nimport { LitElement, html } from \"lit\";\nimport { customElement } from \"lit/decorators.js\";\nimport { withStores } from \"@nanostores/lit\";\n\nimport { profile } from \"./stores/profile.js\";\n\n@customElement(\"my-header\")\nclass MyHeader extends withStores(LitElement, [profile]) {\n  render() {\n    return html`\u003cheader\u003e${profile.get().userId}\u003c/header\u003e`;\n  }\n}\n```\n\nOr as a Reactive Controller with `StoreController`:\n\n```ts\nimport { LitElement, html } from \"lit\";\nimport { customElement } from \"lit/decorators.js\";\nimport { StoreController } from \"@nanostores/lit\";\n\nimport { profile } from \"./stores/profile.js\";\n\n@customElement(\"my-header\")\nclass MyHeader extends LitElement {\n  private profileController = new StoreController(this, profile);\n  render() {\n    return html`\u003cheader\u003e${this.profileController.value.userId}\u003c/header\u003e`;\n  }\n}\n```\n\n[Nano Stores]: https://github.com/nanostores/nanostores/\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fnanostores%2Flit","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fnanostores%2Flit","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fnanostores%2Flit/lists"}