{"id":16125696,"url":"https://github.com/dy/signal-struct","last_synced_at":"2026-02-24T04:02:01.095Z","repository":{"id":63493517,"uuid":"567849762","full_name":"dy/signal-struct","owner":"dy","description":"Combined signal storage","archived":false,"fork":false,"pushed_at":"2024-03-04T03:05:22.000Z","size":77,"stargazers_count":12,"open_issues_count":1,"forks_count":1,"subscribers_count":2,"default_branch":"main","last_synced_at":"2025-07-30T19:17:49.325Z","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":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/dy.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":"2022-11-18T18:20:22.000Z","updated_at":"2025-04-06T21:10:29.000Z","dependencies_parsed_at":"2024-01-10T00:32:53.865Z","dependency_job_id":"1a01d3ec-8b5c-4f49-8ea2-d3d9efac42bd","html_url":"https://github.com/dy/signal-struct","commit_stats":{"total_commits":53,"total_committers":1,"mean_commits":53.0,"dds":0.0,"last_synced_commit":"7c3859c62b9267d000a1a22807ad7128a27cdb0e"},"previous_names":[],"tags_count":16,"template":false,"template_full_name":null,"purl":"pkg:github/dy/signal-struct","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/dy%2Fsignal-struct","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/dy%2Fsignal-struct/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/dy%2Fsignal-struct/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/dy%2Fsignal-struct/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/dy","download_url":"https://codeload.github.com/dy/signal-struct/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/dy%2Fsignal-struct/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":29771040,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-02-24T04:01:02.180Z","status":"ssl_error","status_checked_at":"2026-02-24T03:59:49.901Z","response_time":75,"last_error":"SSL_read: 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":[],"created_at":"2024-10-09T21:30:45.709Z","updated_at":"2026-02-24T04:02:01.052Z","avatar_url":"https://github.com/dy.png","language":"JavaScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"# signal-struct\n\n\u003e Structure for storing/handling multiple signals or reactive values\n\n```js\nimport signalStruct from 'signal-struct'\nimport { signal, computed, batch } from '@preact/signals-core'\n\nlet s = signalStruct({\n  x: 0,\n  y: signal(1),\n  z: { r: 2, i: signal(3) },\n  get v() { return this.x * this.y }, // computed\n});\n\n// subscribes to only x and y without need for .value access\nlet xy = computed(() =\u003e s.x + s.y)\ns.x = 2\ns.y = 3\nxy.value // 5\n\n// subscribes to deep values too: only z.r and z.i update the `len`\nlet len = computed(() =\u003e (s.z.r**2 + s.z.i**2)**0.5)\ns.z.r = 3\ns.z.i = 4\nlen.value // 5\n\n// updating internal objects turns them into signals too\ns.z = { r: 5, i: 12}\nlen.value // 13\n\n// update multiple props\nbatch(() =\u003e Object.assign(s, { x: 1, y: 1 }))\nxy.value // 2\n\n// getter is computed\ns.v // 1\n\n// can subscribe to reactive sources\nlet s2 = signalStruct({\n  p: new Promise(ok =\u003e setTimeout(() =\u003e ok(123)))\n})\ns2.p  // null\n// ...\ns2.p  // 123\n\n// can inherit from proto, including other struct\nlet s3 = signalStruct({v:456}, s2)\ns3.p // 123\ns3.v // 456\n```\n\nSupported reactive sources: see [sube](https://github.com/dy/sube).\n\u003c!--\nSupported signals: [@preact/signals](https://github.com/preactjs/signals), [usignal](https://www.npmjs.com/package/usignal), [value-ref](https://github.com/dy/value-ref). --\u003e\n\n## Alternatives\n\n* [preact-observables](https://github.com/melnikov-s/preact-observables)\n* [deepsignal](https://github.com/luisherranz/deepsignal)\n* [@deepsignal/preact](https://github.com/EthanStandel/deepsignal/tree/main/packages/preact)\n* [preact-observables](https://github.com/melnikov-s/preact-observables)\n* [hyperactiv](https://github.com/elbywan/hyperactiv)\n\n\u003cp align=\"center\"\u003e\u003ca href=\"https://github.com/krsnzd/license/\"\u003e🕉\u003c/a\u003e\u003c/p\u003e\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fdy%2Fsignal-struct","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fdy%2Fsignal-struct","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fdy%2Fsignal-struct/lists"}