{"id":13826733,"url":"https://github.com/mseddon/preact-nx-observer","last_synced_at":"2025-10-30T10:10:25.956Z","repository":{"id":57329504,"uuid":"174992588","full_name":"mseddon/preact-nx-observer","owner":"mseddon","description":"A simple preact decorator for @nx-js/observer-util","archived":false,"fork":false,"pushed_at":"2019-03-12T12:00:59.000Z","size":53,"stargazers_count":21,"open_issues_count":0,"forks_count":0,"subscribers_count":0,"default_branch":"master","last_synced_at":"2025-04-19T10:57:38.940Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"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/mseddon.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":"2019-03-11T12:10:24.000Z","updated_at":"2024-04-18T03:06:07.000Z","dependencies_parsed_at":"2022-09-14T19:01:05.978Z","dependency_job_id":null,"html_url":"https://github.com/mseddon/preact-nx-observer","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/mseddon%2Fpreact-nx-observer","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/mseddon%2Fpreact-nx-observer/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/mseddon%2Fpreact-nx-observer/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/mseddon%2Fpreact-nx-observer/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/mseddon","download_url":"https://codeload.github.com/mseddon/preact-nx-observer/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":251642898,"owners_count":21620387,"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-08-04T09:01:43.317Z","updated_at":"2025-10-30T10:10:20.937Z","avatar_url":"https://github.com/mseddon.png","language":"JavaScript","funding_links":[],"categories":["JavaScript"],"sub_categories":[],"readme":"# preact-nx-observer\n\u003e Simple `preact-mobx` interface for `nx-js/observer-util`.\n\n## About\n[mobx](https://github.com/mobxjs/mobx) is a great little reactive state library, but sometimes you just want to shave off a few more kb from your bundle.\n\nFortunately [ns-js/observer-util](https://github.com/nx-js/observer-util) is a tiny (~3k gzipped) library supporting the core of `mobx`.\n\nThis library provides a *very* tiny decorator syntax for `nx-js/observer-util`. By decorating a\nPreact `Component` class as `@observer`, the component will automagically re-render whenever a dependent observable value changes.\n\n## Usage\n```javascript\nimport { h, Component, render } from \"preact\";\nimport { observable } from \"@nx-js/observer-util\";\nimport { observer } from \"preact-nx-observer\";\n\nlet thing = observable({ foo: \"This is foo's data\"});\n\n@observer\nclass Foo extends Component {\n    render() {\n        return \u003ch1\u003e{thing.foo}\u003c/h1\u003e\n    }\n}\n\nrender(\u003cFoo/\u003e, document.querySelector(\"#content\"));\n\nsetInterval(() =\u003e thing.foo += \"!\", 1000)\n```\n\nAnd thats it!\n\n## License\n\nMIT","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fmseddon%2Fpreact-nx-observer","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fmseddon%2Fpreact-nx-observer","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fmseddon%2Fpreact-nx-observer/lists"}