Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 8 additions & 0 deletions packages/mobx/CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,13 @@
# mobx

## 6.15.1

### Patch Changes

- [`df81c144fb148b64140d761aa61f032a7f429e12`](https://github.com/mobxjs/mobx/commit/df81c144fb148b64140d761aa61f032a7f429e12) [#4523](https://github.com/mobxjs/mobx/pull/4523) Thanks [@exzos28](https://github.com/exzos28)! - Make `FlowCancellationError` a proper `Error` instance while preserving its previous string representation.

- [`21fc4de6c09a77caf115aedd2fe6df972637412b`](https://github.com/mobxjs/mobx/commit/21fc4de6c09a77caf115aedd2fe6df972637412b) [#4626](https://github.com/mobxjs/mobx/pull/4626) Thanks [@kubk](https://github.com/kubk)! - Export `CancellablePromise` from the public `mobx` entrypoint.

## 6.15.0

### Minor Changes
Expand Down
2 changes: 1 addition & 1 deletion packages/mobx/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "mobx",
"version": "6.15.0",
"version": "6.15.1",
"description": "Simple, scalable state management.",
"source": "src/mobx.ts",
"main": "dist/index.js",
Expand Down
13 changes: 10 additions & 3 deletions packages/mobx/src/api/flow.ts
Original file line number Diff line number Diff line change
Expand Up @@ -17,10 +17,17 @@ export const FLOW = "flow"

let generatorId = 0

export function FlowCancellationError() {
this.message = "FLOW_CANCELLED"
export class FlowCancellationError extends Error {
constructor() {
super("FLOW_CANCELLED")
Object.setPrototypeOf(this, new.target.prototype)
this.name = "FlowCancellationError"
}

toString() {
return `Error: ${this.message}`
}
}
FlowCancellationError.prototype = Object.create(Error.prototype)

export function isFlowCancellationError(error: Error) {
return error instanceof FlowCancellationError
Expand Down
1 change: 1 addition & 0 deletions packages/mobx/src/mobx.ts
Original file line number Diff line number Diff line change
Expand Up @@ -108,6 +108,7 @@ export {
flow,
isFlow,
flowResult,
CancellablePromise,
FlowCancellationError,
isFlowCancellationError,
toJS,
Expand Down
Loading