@weapnl/js-junction 0.1.0 → 0.1.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/CHANGELOG.md CHANGED
@@ -2,6 +2,14 @@
2
2
 
3
3
  ## Unreleased
4
4
 
5
+ ## v0.1.1
6
+ - Added functionality to add the same callback on a request multiple times.
7
+ - ⚠️ With the old functionality setting a callback on a request would overwrite the globally defined callback. This is no longer the case, as both the global and request callbacks will be executed.
8
+ - Improved how axios responses are handled.
9
+ - ⚠️ Deprecated `failed` getter on the `Response` class in favor of a new `isFailed` getter.
10
+ - Added `onCancelled` method on `Api` and `Response` classes.
11
+ - Updated the `docker-compose.yml` file to use the `node:22` image.
12
+
5
13
  ## v0.1.0
6
14
  - Added the Temporary Media Upload functionality.
7
15
 
package/README.md CHANGED
@@ -311,11 +311,27 @@ let request = await api.request('users')
311
311
  // Any other status code not caught by other callbacks.
312
312
  })
313
313
  .onFinished((response) => {
314
- // After the request was finished (cancelled requests excluded).
314
+ // After the request was finished (a request is finished if it returned a response).
315
+ })
316
+ .onCancelled((response) => {
317
+ // When a request is cancelled.
315
318
  })
316
319
  .get();
317
320
  ```
318
321
 
322
+ It's possible to clear the currently set callbacks on a request.
323
+
324
+ ```javascript
325
+ request
326
+ .clearOnSuccessCallbacks()
327
+ .clearOnUnauthorizedCallbacks()
328
+ .clearOnForbiddenCallbacks()
329
+ .clearOnValidationErrorCallbacks()
330
+ .clearOnErrorCallbacks()
331
+ .clearOnFinishedCallbacks()
332
+ .clearOnCancelledCallbacks();
333
+ ```
334
+
319
335
  **Cancel requests**
320
336
 
321
337
  If you want to cancel a pending request, you can do the following: