Skip to content

Commit a5fc66b

Browse files
committed
Ducktype
1 parent e7d241c commit a5fc66b

File tree

3 files changed

+9
-7
lines changed

3 files changed

+9
-7
lines changed

package-lock.json

Lines changed: 2 additions & 3 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

package.json

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -113,6 +113,7 @@
113113
"@babel/register": "^7.12.10",
114114
"@changesets/changelog-github": "^0.4.1",
115115
"@changesets/cli": "^2.18.0",
116+
"@preact/signals-core": "^1.11.0",
116117
"baseline-rts": "npm:preact-render-to-string@latest",
117118
"benchmarkjs-pretty": "^2.0.1",
118119
"check-export-map": "^1.3.1",
@@ -147,8 +148,5 @@
147148
},
148149
"publishConfig": {
149150
"provenance": true
150-
},
151-
"dependencies": {
152-
"@preact/signals-core": "^1.11.0"
153151
}
154152
}

src/index.js

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -744,5 +744,10 @@ export const render = renderToString;
744744
export const renderToStaticMarkup = renderToString;
745745

746746
function isSignal(x) {
747-
return x instanceof Signal;
747+
return (
748+
x !== null &&
749+
typeof x === 'object' &&
750+
typeof x.peek === 'function' &&
751+
'value' in x
752+
);
748753
}

0 commit comments

Comments
 (0)