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

feat(alm): add cancellation message to TaskAbortError, listenerApi.signal & forkApi.signal. #2023

Commits on Feb 12, 2022

  1. feat(alm): add meaningful cancellation reasons to TaskAbortError and …

    …listenerApi.signal
    
    listenerApi.signal.reason can be one of
    
    - 'listener-cancelled'
    - 'listener-completed'
    
    forkApi.signal.reason can be one of
    
    - 'listener-cancelled'
    - 'listener-completed'
    - 'task-cancelled'
    - 'task-completed'
    
    BREAKING CHANGE: renamed TaskAbortError.reason -> TaskAbortError.code
    
    ---
    
    - Build log
    
    ```bash
    $ yarn workspace @rtk-incubator/action-listener-middleware run build
    Build "actionListenerMiddleware" to dist/esm:
           1739 B: index.modern.js.gz
           1566 B: index.modern.js.br
    Build "actionListenerMiddleware" to dist/module:
          2.41 kB: index.js.gz
          2.15 kB: index.js.br
    Build "actionListenerMiddleware" to dist/cjs:
           2.4 kB: index.js.gz
          2.15 kB: index.js.br
    ```
    
    - Test log
    
    ```bash
    $ yarn workspace @rtk-incubator/action-listener-middleware run test --coverage
     PASS  src/tests/listenerMiddleware.test.ts (5.738 s)
     PASS  src/tests/effectScenarios.test.ts
     PASS  src/tests/fork.test.ts
     PASS  src/tests/useCases.test.ts
    ---------------|---------|----------|---------|---------|-------------------
    File           | % Stmts | % Branch | % Funcs | % Lines | Uncovered Line #s
    ---------------|---------|----------|---------|---------|-------------------
    All files      |   97.72 |    91.38 |   94.64 |   97.55 |
     exceptions.ts |     100 |        0 |     100 |     100 | 17
     index.ts      |    97.4 |     97.5 |    92.5 |   97.32 | 190,214,252-253
     task.ts       |   97.06 |       80 |     100 |    96.3 | 30
     utils.ts      |     100 |    85.71 |     100 |     100 | 52
    ---------------|---------|----------|---------|---------|-------------------
    
    Test Suites: 4 passed, 4 total
    Tests:       72 passed, 72 total
    Snapshots:   0 total
    Time:        6.796 s
    Ran all test suites.
    ```
    FaberVitale committed Feb 12, 2022
    Configuration menu
    Copy the full SHA
    75e8275 View commit details
    Browse the repository at this point in the history