Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Change state event #17

Merged
merged 1 commit into from
Aug 28, 2024
Merged

Change state event #17

merged 1 commit into from
Aug 28, 2024

Conversation

Celtian
Copy link
Owner

@Celtian Celtian commented Aug 28, 2024

✍️ Describe your changes

Change state input function added to allow acces to inner state...

<ng-container
  *ngxSuspense="
    let data of observable;
    loading: loading;
    empty: empty;
    error: error
    stateChangeFn: onStateChange"
>
  <pre>{{ data | json }}</pre>
</ng-container>
<ng-template #loading>Loading ...</ng-template>
<ng-template #empty>Incoming data are empty</ng-template>
<ng-template #error let-tryAgain let-error="error">
  <pre>{{ error }}</pre>
  <button (click)="tryAgain()">Try again</button>
</ng-template>
  public onStateChange = <T>(state: NgxSuspenseState<T>): void => {
    console.log(state);
  };

🔗 Issue ticket number and link

None

✅ Checklist before requesting a review

  • I have performed a self-review of my code.
  • If it is a core feature, I have added thorough tests.
  • I have checked that affected pages are responsive.
  • I have checked that there are no z-index issues on affected pages.

Copy link

🧪 Unit tests

Caution

Coverage does not meet threshold
Branches coverage not met for global: expected >=80%, but got 63.1578947368421%

St.
Category Percentage Covered / Total
🟢 Statements
88.7% (-0.83% 🔻)
157/177
🟡 Branches
63.16% (-4.41% 🔻)
24/38
🟡 Functions
75% (-5% 🔻)
9/12
🟢 Lines
88.7% (-0.83% 🔻)
157/177
Show files with reduced coverage 🔻
St.
File Statements Branches Functions Lines
🟢 ngx-suspense-of.directive.ts
88.7% (-0.83% 🔻)
63.16% (-4.41% 🔻)
75% (-5% 🔻)
88.7% (-0.83% 🔻)

Test suite run success

18 tests passing in 2 suites.

Report generated by 🧪jest coverage report action from 33b2352

@Celtian Celtian merged commit e244887 into master Aug 28, 2024
3 checks passed
@Celtian Celtian deleted the feat/change-state branch August 28, 2024 20:32
@Celtian Celtian linked an issue Aug 28, 2024 that may be closed by this pull request
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Ability to access the state from the component
1 participant