Skip to content

Commit dad063a

Browse files
authored
Better error message.
1 parent cab14c4 commit dad063a

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed

src/generators/observe.js

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,9 @@ export default function(initialize) {
77
const dispose = initialize(change);
88

99
if (dispose != null && typeof dispose !== "function") {
10-
throw new Error("invalid dispose");
10+
throw new Error(typeof dispose.then === "function"
11+
? "async initializers are not supported"
12+
: "initializer returned something, but not a dispose function");
1113
}
1214

1315
function change(x) {

0 commit comments

Comments
 (0)