Skip to content

Commit affa658

Browse files
committed
setup and developed ngx-async-with-status
1 parent 8268ec9 commit affa658

File tree

3 files changed

+27
-27
lines changed

3 files changed

+27
-27
lines changed

README.md

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -97,19 +97,19 @@ class SomeComponent {
9797

9898
### Inputs
9999
* asyncWithStatus: Binds an observable value to the directive for tracking its state.
100-
*
100+
101101
## Structural Directives
102102
The following structural directives are used within the asyncWithStatus directive to conditionally render content based on the state of the observable.
103103

104-
* isLoading: Renders the content when the observable is loading. Use this directive to display loading indicators or messages.
104+
* **isLoading**: Renders the content when the observable is loading. Use this directive to display loading indicators or messages.
105105

106-
* isLoaded: Renders the content when the observable is successfully loaded. Use this directive to display the main content that should be shown when the data is available.
106+
* **isLoaded**: Renders the content when the observable is successfully loaded. Use this directive to display the main content that should be shown when the data is available.
107107

108-
* error: Renders the content when an error occurs while loading the observable. Use this directive to display error messages or error handling UI.
108+
* **error**: Renders the content when an error occurs while loading the observable. Use this directive to display error messages or error handling UI.
109109

110-
* isLoadedWithData: Renders the content when the observable is loaded with data. Use this directive to display content that requires access to the loaded data. You can access the data using the let-data directive syntax.
110+
* **isLoadedWithData**: Renders the content when the observable is loaded with data. Use this directive to display content that requires access to the loaded data. You can access the data using the let-data directive syntax.
111111

112-
* isLoadedWithoutData: Renders the content when the observable is loaded without data. Use this
112+
* **isLoadedWithoutData**: Renders the content when the observable is loaded without data. Use this
113113

114114
## AsyncWithStatusPipe
115115
The `AsyncWithStatusPipe` is an Angular pipe that provides additional functionality over the built-in async pipe.

projects/ngx-async-with-status/README.md

Lines changed: 20 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
# ngx-async-with-status
22

3-
The `ngx-async-with-status` library provides two powerful tools for handling and displaying the status of asynchronous data in Angular applications:
4-
the `asyncWithStatus` directive and the `AsyncWithStatusPipe`.
3+
The `ngx-async-with-status` library provides two powerful tools for handling and displaying the status of asynchronous data in Angular applications:
4+
the `asyncWithStatus` directive and the `AsyncWithStatusPipe`.
55
These tools enable you to provide visual feedback to users during data loading and error states, and simplify error handling and state management in your templates.
66

77
## Features
@@ -46,11 +46,11 @@ export class YourModule { }
4646
````
4747

4848
## asyncWithStatus Directive
49-
The `asyncWithStatus` directive is an Angular directive that tracks the state of an observable value and renders different structural directives based on its state.
49+
The `asyncWithStatus` directive is an Angular directive that tracks the state of an observable value and renders different structural directives based on its state.
5050
It provides a convenient way to handle asynchronous operations and display loading indicators, success messages, error messages, and other relevant UI components.
5151

5252
## Usage
53-
To use the asyncWithStatus directive, add it as an attribute directive on an HTML element and bind an observable value to it.
53+
To use the asyncWithStatus directive, add it as an attribute directive on an HTML element and bind an observable value to it.
5454
Then, use the structural directives provided by the asyncWithStatus directive to conditionally render content based on the state of the observable.
5555

5656
````ts
@@ -97,19 +97,19 @@ class SomeComponent {
9797

9898
### Inputs
9999
* asyncWithStatus: Binds an observable value to the directive for tracking its state.
100-
*
100+
101101
## Structural Directives
102102
The following structural directives are used within the asyncWithStatus directive to conditionally render content based on the state of the observable.
103103

104-
* isLoading: Renders the content when the observable is loading. Use this directive to display loading indicators or messages.
104+
* **isLoading**: Renders the content when the observable is loading. Use this directive to display loading indicators or messages.
105105

106-
* isLoaded: Renders the content when the observable is successfully loaded. Use this directive to display the main content that should be shown when the data is available.
106+
* **isLoaded**: Renders the content when the observable is successfully loaded. Use this directive to display the main content that should be shown when the data is available.
107107

108-
* error: Renders the content when an error occurs while loading the observable. Use this directive to display error messages or error handling UI.
108+
* **error**: Renders the content when an error occurs while loading the observable. Use this directive to display error messages or error handling UI.
109109

110-
* isLoadedWithData: Renders the content when the observable is loaded with data. Use this directive to display content that requires access to the loaded data. You can access the data using the let-data directive syntax.
110+
* **isLoadedWithData**: Renders the content when the observable is loaded with data. Use this directive to display content that requires access to the loaded data. You can access the data using the let-data directive syntax.
111111

112-
* isLoadedWithoutData: Renders the content when the observable is loaded without data. Use this
112+
* **isLoadedWithoutData**: Renders the content when the observable is loaded without data. Use this
113113

114114
## AsyncWithStatusPipe
115115
The `AsyncWithStatusPipe` is an Angular pipe that provides additional functionality over the built-in async pipe.
@@ -118,25 +118,25 @@ It allows you to handle and display the status of asynchronous data loading, suc
118118
## Usage
119119

120120
Use the asyncWithStatus pipe in your template to handle and display the status of asynchronous data:
121-
The `AsyncWithStatusPipe` is an Angular pipe that provides additional functionality over the built-in `async` pipe.
121+
The `AsyncWithStatusPipe` is an Angular pipe that provides additional functionality over the built-in `async` pipe.
122122
It allows you to handle and display the status of asynchronous data loading, such as loading state, error state, and loaded state, all within the template.
123123
````ts
124124
@Component({
125-
selector: 'some-component',
126-
templateUrl: './some-component.component.html',
125+
selector: 'some-component',
126+
templateUrl: './some-component.component.html',
127127
})
128128
class SomeComponent {
129-
public data$ = of({ title: 'test' }).pipe(delay(1000));
130-
public emptyData$ = of([]).pipe(delay(1000));
129+
public data$ = of({ title: 'test' }).pipe(delay(1000));
130+
public emptyData$ = of([]).pipe(delay(1000));
131131
}
132132
````
133133
````html
134134
<div *ngIf="data$ | asyncWithStatus as data">
135-
<div *ngIf="data.isLoading" class="loading">Loading...</div>
136-
<div *ngIf="data.error" class="error">Error: {{ data.error?.message }}</div>
137-
<div *ngIf="data.loaded" class="loaded">
138-
{{ data.value?.title }}
139-
</div>
135+
<div *ngIf="data.isLoading" class="loading">Loading...</div>
136+
<div *ngIf="data.error" class="error">Error: {{ data.error?.message }}</div>
137+
<div *ngIf="data.loaded" class="loaded">
138+
{{ data.value?.title }}
139+
</div>
140140
</div>
141141
````
142142

projects/ngx-async-with-status/package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "ngx-async-with-status",
3-
"version": "1.0.3",
3+
"version": "1.0.4",
44
"author": "Emre Baskan",
55
"email": "[email protected]",
66
"peerDependencies": {

0 commit comments

Comments
 (0)