joanllenas / ngx-remotedata

💥 Synchronize data fetching and UI state
BSD 3-Clause "New" or "Revised" License
32 stars 6 forks source link

API request - add possibility to create template with directives #36

Open pogiaron opened 2 years ago

pogiaron commented 2 years ago

I think it would be nice to use ngx-remotedata like this:

<div [remoteData]="service.state">
  <div *isNotAsked>Not asked...</div>
  <div *isLoading>Loading...</div>
  <div *isSuccess #success="successVal">Success...</div>
  <div *isFailure #error="errorVal">Failure...</div>
</div>

What do you think?

joanllenas commented 2 years ago

HI @pogiaron , I don't see any issues with this approach. But, what are the benefits of using structural directives here?