@ngx-cocktail/destroyable
Version:
The library contains code for destoyable feature.
58 lines (41 loc) • 2.39 kB
Markdown
# @ngx-cocktail/destroyable
The library contains code for destoyable feature.
Warning! This feature is experimental and can include known and undiscovered errors.
[](https://github.com/kostetskyroma/ngx-cocktail/issues)
[](https://github.com/kostetskyroma/ngx-cocktail/network)
[](https://github.com/kostetskyroma/ngx-cocktail/stargazers)
[](https://github.com/kostetskyroma/ngx-cocktail/blob/master/LICENSE)
[]()
[]()
[]()
[]()
[]()
[]()
## What's New
- Angular 14 support 🥳
## Compatibility
| Angular 14 | Angular 13 | Angular 12 | Angular 11 | Angular 10 | Angular 9 |
| ----------- | ----------- | ----------- | ----------- | ----------- | ---------- |
| >=`v14.0.1` | >=`v13.0.1` | >=`v12.0.1` | >=`v11.0.1` | >=`v10.0.1` | >=`v9.0.1` |
## Installation
npm install @ngx-cocktail/common @ngx-cocktail/destroyable
## Usage
import { Features } from '@ngx-cocktail/common';
import { DestroyableFeature } from '@ngx-cocktail/destroyable';
@Features([DestroyableFeature()])
export class AppComponent implements OnInit {
public destroyed$!: Observable<unknown>;
ngOnInit(): void {
interval(1000)
.pipe(takeUntil(this.destroyed$))
.subscribe((value) => {
...
});
}
}
## Publishing
1. Commit & push your changes
2. Update a version in package.json
3. Run `npm run build:destroyable`
4. Navigate to `dist/destroyable`
5. Run `npm publish`