提交 cfcd3324 编写于 作者: fxy060608's avatar fxy060608

chore: remove unused log

上级 76d8643c
...@@ -37,12 +37,7 @@ export function initBridge( ...@@ -37,12 +37,7 @@ export function initBridge(
emitter.off(`${subscribeNamespace}.${event}`, callback) emitter.off(`${subscribeNamespace}.${event}`, callback)
}, },
subscribeHandler(event: string, args: unknown, pageId?: number): void { subscribeHandler(event: string, args: unknown, pageId?: number): void {
if (__DEV__) {
console.log(
formatLog(subscribeNamespace, 'subscribeHandler', pageId, event, args)
)
}
emitter.emit(`${subscribeNamespace}.${event}`, args, pageId) emitter.emit(`${subscribeNamespace}.${event}`, args, pageId)
}, }
} }
} }
...@@ -24,7 +24,7 @@ function onInvokeServiceMethod( ...@@ -24,7 +24,7 @@ function onInvokeServiceMethod(
{ {
id, id,
name, name,
args, args
}: { }: {
id: number id: number
name: string name: string
...@@ -45,8 +45,5 @@ function onInvokeServiceMethod( ...@@ -45,8 +45,5 @@ function onInvokeServiceMethod(
handler(args, publish) handler(args, publish)
} else { } else {
publish({}) publish({})
if (__DEV__) {
console.error(formatLog('invokeViewMethod', name, 'not register'))
}
} }
} }
...@@ -22,15 +22,9 @@ export function subscribeViewMethod(pageId: number) { ...@@ -22,15 +22,9 @@ export function subscribeViewMethod(pageId: number) {
* @param pageId * @param pageId
*/ */
export function unsubscribeViewMethod(pageId: number) { export function unsubscribeViewMethod(pageId: number) {
if (__DEV__) {
console.log(formatLog('unsubscribeViewMethod', pageId, INVOKE_VIEW_API))
}
UniViewJSBridge.unsubscribe(normalizeViewMethodName(pageId, INVOKE_VIEW_API)) UniViewJSBridge.unsubscribe(normalizeViewMethodName(pageId, INVOKE_VIEW_API))
Object.keys(viewMethods).forEach((name) => { Object.keys(viewMethods).forEach(name => {
if (name.indexOf(pageId + '.') === 0) { if (name.indexOf(pageId + '.') === 0) {
if (__DEV__) {
console.log(formatLog('unsubscribeViewMethod', name))
}
delete viewMethods[name] delete viewMethods[name]
} }
}) })
...@@ -56,7 +50,7 @@ function onInvokeViewMethod( ...@@ -56,7 +50,7 @@ function onInvokeViewMethod(
{ {
id, id,
name, name,
args, args
}: { }: {
id: number id: number
name: string name: string
...@@ -73,8 +67,5 @@ function onInvokeViewMethod( ...@@ -73,8 +67,5 @@ function onInvokeViewMethod(
handler(args, publish) handler(args, publish)
} else { } else {
publish({}) publish({})
if (__DEV__) {
console.error(formatLog('invokeViewMethod', name, 'not register'))
}
} }
} }
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册