Skip to content

Commit

Permalink
setimeout (#44)
Browse files Browse the repository at this point in the history
  • Loading branch information
kubk authored Nov 27, 2023
1 parent 4ce2180 commit ef9cdf1
Show file tree
Hide file tree
Showing 2 changed files with 15 additions and 13 deletions.
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
{
"version": "2.2.2",
"version": "2.2.3",
"license": "MIT",
"files": [
"dist",
Expand Down
26 changes: 14 additions & 12 deletions src/redux-devtools/mobx-redux-devtools.ts
Original file line number Diff line number Diff line change
Expand Up @@ -41,19 +41,21 @@ const startSpyReport = (event: PureSpyEvent) => {
return;
}
scheduled.push(() => {
try {
const name = getDebugName(event.object) + event.name;
} catch (e: any) {
if (config.debug) {
console.warn('Spy object is not observable: ' + e.message);
setTimeout(() => {
try {
const name = getDebugName(event.object) + event.name;
} catch (e: any) {
if (config.debug) {
console.warn('Spy object is not observable: ' + e.message);
}
return;
}
return;
}
const name = debugNameToHuman(getDebugName(event.object) + event.name);
const devTools = devtoolsMap.get(getDebugName(event.object));
if (devTools) {
devTools.send(name, toJsWithComputeds(event.object));
}
const name = debugNameToHuman(getDebugName(event.object) + event.name);
const devTools = devtoolsMap.get(getDebugName(event.object));
if (devTools) {
devTools.send(name, toJsWithComputeds(event.object));
}
});
});
};

Expand Down

0 comments on commit ef9cdf1

Please sign in to comment.