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

chore: remove unused log

上级 76d8643c
......@@ -37,12 +37,7 @@ export function initBridge(
emitter.off(`${subscribeNamespace}.${event}`, callback)
},
subscribeHandler(event: string, args: unknown, pageId?: number): void {
if (__DEV__) {
console.log(
formatLog(subscribeNamespace, 'subscribeHandler', pageId, event, args)
)
}
emitter.emit(`${subscribeNamespace}.${event}`, args, pageId)
},
}
}
}
......@@ -24,7 +24,7 @@ function onInvokeServiceMethod(
{
id,
name,
args,
args
}: {
id: number
name: string
......@@ -45,8 +45,5 @@ function onInvokeServiceMethod(
handler(args, publish)
} else {
publish({})
if (__DEV__) {
console.error(formatLog('invokeViewMethod', name, 'not register'))
}
}
}
......@@ -22,15 +22,9 @@ export function subscribeViewMethod(pageId: number) {
* @param pageId
*/
export function unsubscribeViewMethod(pageId: number) {
if (__DEV__) {
console.log(formatLog('unsubscribeViewMethod', 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 (__DEV__) {
console.log(formatLog('unsubscribeViewMethod', name))
}
delete viewMethods[name]
}
})
......@@ -56,7 +50,7 @@ function onInvokeViewMethod(
{
id,
name,
args,
args
}: {
id: number
name: string
......@@ -73,8 +67,5 @@ function onInvokeViewMethod(
handler(args, publish)
} else {
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.
先完成此消息的编辑!
想要评论请 注册