Skip to content

Commit

Permalink
pass action error to devtools
Browse files Browse the repository at this point in the history
  • Loading branch information
Marcisbee committed Feb 22, 2024
1 parent 989938c commit 26c7d4d
Show file tree
Hide file tree
Showing 4 changed files with 11 additions and 4 deletions.
5 changes: 5 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,10 @@
# Changelog

## 2.4.2

### Other
* Pass action error to devtools.

## 2.4.1

### Bugfix
Expand Down
4 changes: 2 additions & 2 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "exome",
"version": "2.4.1",
"version": "2.4.2",
"description": "Proxy based store manager for deeply nested states",
"main": "./dist/exome.js",
"module": "./dist/exome.mjs",
Expand Down
4 changes: 3 additions & 1 deletion src/devtools-exome.ts
Original file line number Diff line number Diff line change
Expand Up @@ -174,7 +174,8 @@ export const exomeDevtools = ({
payload: action,
});

return () => {
return (error) => {
action.error = error as any;
action.time = performance.now() - start;
action.after = exomeToJson(instance);

Expand Down Expand Up @@ -286,6 +287,7 @@ interface Action {
now: number;
time?: number;
trace: string;
error?: string;
before: Record<string, any>;
after?: Record<string, any>;
}

0 comments on commit 26c7d4d

Please sign in to comment.