Skip to content

Commit 98a24a7

Browse files
committed
Enable getting IJSObjectReference to a JS function
1 parent 486813e commit 98a24a7

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

src/JSInterop/Microsoft.JSInterop.JS/src/src/Microsoft.JSInterop.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -155,7 +155,7 @@ export module DotNet {
155155
* @throws Error if the given value is not an Object.
156156
*/
157157
export function createJSObjectReference(jsObject: any): any {
158-
if (jsObject && typeof jsObject === "object") {
158+
if (jsObject && (typeof jsObject === "object" || jsObject instanceof Function)) {
159159
cachedJSObjectsById[nextJsObjectId] = new JSObject(jsObject);
160160

161161
const result = {

0 commit comments

Comments
 (0)