Skip to content

Commit 1b71e52

Browse files
authored
fix inspector cleanup (#1457)
1 parent 0f2c92e commit 1b71e52

File tree

1 file changed

+5
-6
lines changed

1 file changed

+5
-6
lines changed

src/client/inspect.js

Lines changed: 5 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,15 +1,14 @@
11
import {Inspector} from "observablehq:runtime";
22

33
export function inspect(value) {
4-
const inspector = new Inspector(document.createElement("div"));
5-
inspector.fulfilled(value);
6-
return inspector._node.firstChild;
4+
const node = document.createElement("div");
5+
new Inspector(node).fulfilled(value);
6+
return node;
77
}
88

99
export function inspectError(value) {
10-
const inspector = new Inspector(document.createElement("div"));
11-
inspector.rejected(value);
12-
const node = inspector._node.firstChild;
10+
const node = document.createElement("div");
11+
new Inspector(node).rejected(value);
1312
node.classList.add("observablehq--error");
1413
return node;
1514
}

0 commit comments

Comments
 (0)