• Home
  • Features
  • Pricing
  • Docs
  • Announcements
  • Sign In

e7h4n / ccstate / 15699879880
100%

Build:
DEFAULT BRANCH: main
Ran 17 Jun 2025 06:30AM UTC
Jobs 1
Files 48
Run time 32min
Badge
Embed ▾
README BADGES
x

If you need to use a raster PNG badge, change the '.svg' to '.png' in the link

Markdown

Textile

RDoc

HTML

Rst

17 Jun 2025 06:29AM UTC coverage: 100.0%. Remained the same
15699879880

push

github

web-flow
refactor: better promise rejection handling

## Why

consider the following case:

``` typescript
const promise$ = computed((get) => {
  return new Promise((_, reject) => {
    reject(new Error())
  })
});

const store = createStore();
store.sub(
  promise$,
  command(() => void 0),
);
```

The `sub` command will evaluate the promise$ once, and if the generated promise is rejected in this evaluation, there is no opportunity in this code to handle this rejection.

## How to Solve This Problem

In this commit, the `sub` command will attach a catch callback to the Promise returned by `computed` to handle exceptions. This does not mean that external access to the promise's exception will be blocked; the promise returned externally still contains the exception. This only prevents the global unhandledRejection.

This handling strategy is similar to preact-signals. https://stackblitz.com/edit/vitejs-vite-i8u9jc24?file=src%2Fpreact-promise.test.ts%3AL36

Co-authored-by: Yuchen Zhang <zhangyc@kanyun.com>
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>

449 of 449 branches covered (100.0%)

Branch coverage included in aggregate %.

29 of 29 new or added lines in 3 files covered. (100.0%)

1600 of 1600 relevant lines covered (100.0%)

26759.63 hits per line

Jobs
ID Job ID Ran Files Coverage
1 15699879880.1 17 Jun 2025 06:30AM UTC 48
100.0
GitHub Action Run
Source Files on build 15699879880
  • Tree
  • List 48
  • Changed 3
  • Source Changed 3
  • Coverage Changed 2
Coverage ∆ File Lines Relevant Covered Missed Hits/Line Branch Hits Branch Misses
  • Back to Repo
  • Github Actions Build #15699879880
  • ebbe2fe1 on github
  • Prev Build on main (#15697804130)
  • Next Build on main (#15700146361)
  • Delete
STATUS · Troubleshooting · Open an Issue · Sales · Support · CAREERS · ENTERPRISE · START FREE · SCHEDULE DEMO
ANNOUNCEMENTS · TWITTER · TOS & SLA · Supported CI Services · What's a CI service? · Automated Testing

© 2026 Coveralls, Inc