{"id":17222930,"url":"https://github.com/rush/ng-connect-state","last_synced_at":"2025-04-14T00:18:13.442Z","repository":{"id":40667796,"uuid":"281026625","full_name":"Rush/ng-connect-state","owner":"Rush","description":"Reactive components for Angular!","archived":false,"fork":false,"pushed_at":"2023-02-04T08:36:51.000Z","size":2580,"stargazers_count":9,"open_issues_count":6,"forks_count":1,"subscribers_count":2,"default_branch":"master","last_synced_at":"2025-03-27T14:21:18.939Z","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":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/Rush.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":"CONTRIBUTING.md","funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2020-07-20T05:53:45.000Z","updated_at":"2023-04-02T12:24:40.000Z","dependencies_parsed_at":"2023-02-18T15:02:14.833Z","dependency_job_id":null,"html_url":"https://github.com/Rush/ng-connect-state","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/Rush%2Fng-connect-state","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Rush%2Fng-connect-state/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Rush%2Fng-connect-state/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Rush%2Fng-connect-state/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/Rush","download_url":"https://codeload.github.com/Rush/ng-connect-state/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":248799968,"owners_count":21163404,"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-10-15T04:06:44.988Z","updated_at":"2025-04-14T00:18:13.415Z","avatar_url":"https://github.com/Rush.png","language":"TypeScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Connect state - Reactive components in Angular\n\n\u003e Automatically bind all asynchronous observables into a simple synchronous sink. Extra features including loading indicators and simple API to reload your observables.\n\n![ng-connect-state](https://github.com/Rush/ng-connect-state/workflows/ng-connect-state/badge.svg)\n\n**NOTE: Ivy required**\n\n## Installation\n\n```bash\nnpm install ng-connect-state @ngneat/until-destroy\n# Or if you use yarn\nyarn add ng-connect-state @ngneat/until-destroy\n```\n\n`@ngneat/until-destroy` is a peer dependency.\n\n## Examples\n\n```ts\nimport { connectState } from 'ng-connect-state';\nimport { UntilDestroy } from '@ngneat/until-destroy';\nimport { interval } from 'rxjs';\n\n@UntilDestroy()\n@Component({ template: `\n  {{ state.timer }}\n  \u003cbutton (click)=\"state.reload()\"\u003c/button\u003e\n  Loading: {{ state.loading.timer }}\n  `\n})\nexport class InboxComponent {\n  ngOnDestroy() { }\n\n  /**\n   this exposes state.timer as a synchronous value!\n  **/\n  state = connectState(this, {\n    timer: interval(1000),\n  })\n}\n```\n\nYou can bind multiple observables and reload them individually as well:\n\n```ts\n@UntilDestroy()\n@Component({})\nexport class HomeComponent {\n  ngOnDestroy() { }\n\n  constructor(private httpClient: HttpClient) {}\n\n  // We'll dispose it on destroy\n  state = connectState(this, {\n    users: httpClient.get('/users'),\n    projects: httpClient.get('/projects'),\n  })\n\n  reloadUsers() {\n    this.state.reload('users');\n  }\n  reloadProjects() {\n    this.state.reload('projects');\n  }\n}\n```\n\n## Contributors ✨\n\nThis project's structuce is based on the amazing [@ngneat/until-destroy](https://github.com/ngneat/until-destroy) repository! Many thanks.\n\n## License\n\nMIT\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Frush%2Fng-connect-state","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Frush%2Fng-connect-state","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Frush%2Fng-connect-state/lists"}