{"id":19501260,"url":"https://github.com/acryps/page-observable","last_synced_at":"2026-06-13T12:02:24.796Z","repository":{"id":188201578,"uuid":"678284482","full_name":"acryps/page-observable","owner":"acryps","description":"Renderable observables for @acryps/page","archived":false,"fork":false,"pushed_at":"2023-12-13T09:55:07.000Z","size":25,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":0,"default_branch":"main","last_synced_at":"2025-02-25T21:33:04.128Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"language":"TypeScript","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/acryps.png","metadata":{"files":{"readme":"readme.md","changelog":null,"contributing":null,"funding":null,"license":null,"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-08-14T07:37:19.000Z","updated_at":"2023-08-14T07:39:07.000Z","dependencies_parsed_at":"2024-11-10T22:22:41.159Z","dependency_job_id":null,"html_url":"https://github.com/acryps/page-observable","commit_stats":null,"previous_names":["acryps/page-observable"],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/acryps/page-observable","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/acryps%2Fpage-observable","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/acryps%2Fpage-observable/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/acryps%2Fpage-observable/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/acryps%2Fpage-observable/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/acryps","download_url":"https://codeload.github.com/acryps/page-observable/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/acryps%2Fpage-observable/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":34283391,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-05-26T15:22:16.424Z","status":"online","status_checked_at":"2026-06-13T02:00:06.617Z","response_time":62,"last_error":null,"robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":true,"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-11-10T22:12:03.048Z","updated_at":"2026-06-13T12:02:24.755Z","avatar_url":"https://github.com/acryps.png","language":"TypeScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"[![npm version](https://badge.acryps.com/npm/@acryps%2Fpage-observable)](http://badge.acryps.com/go/npm/@acryps%2Fpage-observable)\n# @acryps/page observables\nAdds observables to page!\n\nCreating an observable\n```\nconst magicNumber = new Observable\u003cnumber\u003e();\n```\n\nListening for changes\n```\nmagicNumber.subscribe(value =\u003e console.log(value));\n```\n\nPushing new changes\n```\nmagicNumber.emit(1);\n```\n\nEmbedding value into component\n```\nclass ItemsComponent extends Component {\n\trender() {\n\t\treturn \u003csection\u003e\n\t\t\tMapped to a string: {magicNumber.map(value =\u003e value.toFixed(3))}\n\n\t\t\tMapped to an element: {magicNumber.map(value =\u003e \u003cem\u003e\n\t\t\t\t{value}\n\t\t\t\u003c/em\u003e)}\n\n\t\t\tAutomatically mapped: {magicNumber} (only recommended for strings \u0026 numbers)\n\t\t\u003c/section\u003e;\n\t}\n}\n```\n\n## Example\n```\n\nclass PageComponent {\n\trender(child) {\n\t\treturn \u003cmain\u003e\n\t\t\t\u003cnav\u003e\n\t\t\t\tShop\n\n\t\t\t\t\u003ca ui-href='/cart'\u003e\n\t\t\t\t\tCart ({CartComponent.items.map(items =\u003e items.length)})\n\t\t\t\t\u003c/a\u003e\n\t\t\t\u003c/nav\u003e\n\n\t\t\t{child}\n\t\t\u003c/main\u003e;\n\t}\n}\n\nclass CartComponent {\n\tstatic items = new Observable\u003cstring[]\u003e();\n\n\titems = [\n\t\t'carrots',\n\t\t'apples'\n\t];\n\n\trender() {\n\t\treturn \u003csection\u003e\n\t\t\t\u003cbutton ui-click={() =\u003e {\n\t\t\t\titems.push('bananas');\n\n\t\t\t\tCartComponent.items.emit(items);\n\t\t\t}}\u003e\n\t\t\u003c/section\u003e;\n\t}\n}\n```\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Facryps%2Fpage-observable","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Facryps%2Fpage-observable","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Facryps%2Fpage-observable/lists"}