Package Exports
- @lonli-lokli/ng-result
- @lonli-lokli/ng-result/bundles/lonli-lokli-ng-result.umd.js
- @lonli-lokli/ng-result/fesm2015/lonli-lokli-ng-result.js
This package does not declare an exports field, so the exports above have been automatically detected and optimized by JSPM instead. If any package subpath is missing, it is recommended to post an issue to the original package (@lonli-lokli/ng-result) to support the "exports" field. If that is not possible, create a JSPM override to customize the exports field for this package.
Readme
Angular Library with set of components/directives/pipes for easier work with data, using https://github.com/Lonli-Lokli/ts-result
About
Result is an union of few types: ResultInitial, ResultPending, ResultFailure and ResultSuccess.
While your data in initial or pending state just use initial() or pending(), because you don't have any real values in this case.
When you receive data from server, use failure or success function, it depends on what you received.
Installation
ng add @lonli-lokli/ng-result
Usage
<ll-result [data]="data$ | async">
<ng-container *ifSuccess="data$ | async; let ok">
Here is the response: {{ok}}
</ng-container>
</ll-result>