{"id":21657518,"url":"https://github.com/navix/ing","last_synced_at":"2026-05-18T18:31:30.850Z","repository":{"id":57132063,"uuid":"441227059","full_name":"navix/ing","owner":"navix","description":"🦥 Simple async state container for RxJS and Angular.","archived":false,"fork":false,"pushed_at":"2022-06-07T18:51:47.000Z","size":5,"stargazers_count":1,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"master","last_synced_at":"2024-04-23T20:18:54.443Z","etag":null,"topics":["angular","rxjs"],"latest_commit_sha":null,"homepage":"","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/navix.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}},"created_at":"2021-12-23T15:49:23.000Z","updated_at":"2021-12-23T19:49:28.000Z","dependencies_parsed_at":"2022-09-03T11:41:21.357Z","dependency_job_id":null,"html_url":"https://github.com/navix/ing","commit_stats":null,"previous_names":[],"tags_count":2,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/navix%2Fing","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/navix%2Fing/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/navix%2Fing/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/navix%2Fing/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/navix","download_url":"https://codeload.github.com/navix/ing/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":244554884,"owners_count":20471316,"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":["angular","rxjs"],"created_at":"2024-11-25T09:26:46.524Z","updated_at":"2026-05-18T18:31:30.778Z","avatar_url":"https://github.com/navix.png","language":"TypeScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"[![npm version](https://badge.fury.io/js/%40novyk%2Fing.svg)](https://www.npmjs.com/@novyk/ing)\n\n# 🦥 Ing\n\nSimple async state container for RxJS and Angular.\n\n## Features\n\n* Stores multiple async operation states: New, Ongoing, Succeed, Failed.\n* Gives Observables with the state.\n* Has a helper operator for RxJS integration.\n* Adapted for using in Angular templates.\n* Easily integrates with your custom services and components.\n* Has no additional dependencies and complex abstractions.\n\n\n## Installation\n\n```\n$ npm i @novyk/ing\n```\n\n\n## Usage\n\n#### Create instance of container\n\n```\nimport { ing, Ing } from '@novyk/ing';\n...\n\ncomponent MyCompontent {\n  loading = new Ing();\n  ...\n}\n```\n\n#### Handle state when making requests\n\n```\nimport { ing, Ing } from '@novyk/ing';\n...\n\ncomponent MyCompontent {\n  ...\n  loadData() {\n    this.loading.start();\n    this.dataService\n      .load()\n      .pipe(\n        ing(this.loading),\n      )\n      ...\n  }\n}\n```\n\n#### Use container in templates\n\n```\n\u003cdiv *ngIf=\"loading.ongoing\"\u003e\n  Data is loading...\n\u003c/div\u003e\n\u003cdiv *ngIf=\"loading.succeed\"\u003e\n  ...\n\u003c/div\u003e\n```\n\nOr subscribe to streams: \n\n```\n\u003cdiv *ngIf=\"loading.ongoing$ | async\"\u003e\n  Data is loading...\n\u003c/div\u003e\n\u003cdiv *ngIf=\"loading.succeed$ | async\"\u003e\n  ...\n\u003c/div\u003e\n```\n\nUsing `ngSwitch`:\n\n```\n\u003cdiv [ngSwitch]=\"loading.status$ | async\"\u003e\n  \u003cng-template ngSwitchCase=\"Ongoing\"\u003e\n    Data is loading...\n  \u003c/ng-template\u003e\n  \u003cng-template ngSwitchCase=\"Succeed\"\u003e\n    ...\n  \u003c/ng-template\u003e\n  \u003cng-template ngSwitchCase=\"Failed\"\u003e\n    Data loading failed!\n  \u003c/ng-template\u003e\n\u003c/div\u003e\n```\n\n\n\n## Licence\n\nMIT\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fnavix%2Fing","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fnavix%2Fing","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fnavix%2Fing/lists"}