Skip to content

Commit

Permalink
fix: gets the name of the function as a key (gronxb#38)
Browse files Browse the repository at this point in the history
* fix: gets the name of the function as a key

* unused code
  • Loading branch information
gronxb authored Apr 20, 2024
1 parent 1d02f60 commit 603bcfc
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 10 deletions.
1 change: 1 addition & 0 deletions .eslintrc.cjs
Original file line number Diff line number Diff line change
Expand Up @@ -25,5 +25,6 @@ module.exports = {
"simple-import-sort/imports": "error",
"simple-import-sort/exports": "error",
"@typescript-eslint/no-non-null-assertion": "off",
"@typescript-eslint/no-unused-vars": "off",
},
};
15 changes: 5 additions & 10 deletions packages/react-native/src/createWebView.tsx
Original file line number Diff line number Diff line change
@@ -1,9 +1,4 @@
import type {
AsyncFunction,
Bridge,
BridgeStore,
Primitive,
} from "@webview-bridge/types";
import type { Bridge, BridgeStore, Primitive } from "@webview-bridge/types";
import { createEvents } from "@webview-bridge/util";
import React, {
createRef,
Expand Down Expand Up @@ -66,10 +61,10 @@ export const createWebView = <BridgeObject extends Bridge>({

const bridgeNames = useMemo(
() =>
Object.values(bridge.getState() ?? {})
.filter((bridge) => typeof bridge === "function")
.map((func) => {
return `'${(func as AsyncFunction).name}'`;
Object.entries(bridge.getState() ?? {})
.filter(([_, bridge]) => typeof bridge === "function")
.map(([name]) => {
return `'${name}'`;
}),
[],
);
Expand Down

0 comments on commit 603bcfc

Please sign in to comment.