@ngneat/subscribe

Subscription Handling Directive

Usage no npm install needed!

<script type="module">
  import ngneatSubscribe from 'https://cdn.skypack.dev/@ngneat/subscribe';
</script>

README

MIT commitizen PRs styled with prettier All Contributors ngneat spectator

Subscription Handling Directive

Installation

npm install @ngneat/subscribe

Usage

First, we need to import the SubscribeModule:

import { SubscribeModule } from '@ngneat/subscribe';

@NgModule({
  imports: [SubscribeModule]
})
class MyModule {}

Now we can use the subscribe directive in our template:

@Component({
  template: `
    <ng-container *subscribe="getUsers$; let users; let error=error">
      {{ users | json }}
      {{ error }}
    </ng-container>
  `
})
class MyComponent {
  getUsers$ = this.service.getUsers();

  constructor(private service: UserService) {}
}

Contributors ✨

Thanks goes to these wonderful people (emoji key):


Netanel Basal

💻 🤔

This project follows the all-contributors specification. Contributions of any kind welcome!

Icons made by Freepik from www.flaticon.com