react-native-webln
Advanced tools
Comparing version 0.1.3 to 0.1.4
@@ -12,3 +12,3 @@ import { MutableRefObject } from "react"; | ||
} | ||
declare const postMessageHandler: (webview: MutableRefObject<WebView>, requests: WebLNProviderWithExtras) => (event: WebViewMessageEvent) => Promise<void>; | ||
export { postMessageHandler, }; | ||
declare const onMessageHandler: (webview: MutableRefObject<WebView>, requests: WebLNProviderWithExtras) => (event: WebViewMessageEvent) => Promise<void>; | ||
export { onMessageHandler, }; |
"use strict"; | ||
Object.defineProperty(exports, "__esModule", { value: true }); | ||
const postMessageHandler = (webview, requests) => async (event) => { | ||
const onMessageHandler = (webview, requests) => async (event) => { | ||
if (!webview.current) { | ||
@@ -66,3 +66,3 @@ console.error("react-native-webln: Reference to webview is not properly set.\n" + | ||
}; | ||
exports.postMessageHandler = postMessageHandler; | ||
exports.onMessageHandler = onMessageHandler; | ||
const injectResponseToWebView = (webview, id, inject) => { | ||
@@ -69,0 +69,0 @@ console.log("inject"); |
@@ -14,3 +14,3 @@ import { MutableRefObject } from "react"; | ||
const postMessageHandler = (webview: MutableRefObject<WebView>, requests: WebLNProviderWithExtras) => async (event: WebViewMessageEvent) => { | ||
const onMessageHandler = (webview: MutableRefObject<WebView>, requests: WebLNProviderWithExtras) => async (event: WebViewMessageEvent) => { | ||
if (!webview.current) { | ||
@@ -98,3 +98,3 @@ console.error( | ||
export { | ||
postMessageHandler, | ||
onMessageHandler, | ||
} |
{ | ||
"name": "react-native-webln", | ||
"description": "Library for supporting WebLN in a WebView", | ||
"version": "0.1.3", | ||
"version": "0.1.4", | ||
"main": "dist/index", | ||
@@ -6,0 +6,0 @@ "scripts": { |
@@ -51,3 +51,3 @@ # react-native-webln | ||
}} | ||
onMessage={postMessageHandler(webview, { | ||
onMessage={onMessageHandler(webview, { | ||
enable: async () => { /* Your implementation goes here */ }, | ||
@@ -54,0 +54,0 @@ getInfo: async () => { /* Your implementation goes here */ }, |
Sorry, the diff of this file is not supported yet
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
27506