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

feat: tree-shaking with bitwise operation

上级 297da09c
......@@ -76,8 +76,10 @@ export const UniLifecycleHooks = [
ON_NAVIGATION_BAR_SEARCH_INPUT_FOCUS_CHANGED,
] as const
export const MINI_PROGRAM_PAGE_RUNTIME_HOOKS = {
onPageScroll: 1,
onShareAppMessage: 1 << 1,
onShareTimeline: 1 << 2,
} as const
export const MINI_PROGRAM_PAGE_RUNTIME_HOOKS = /*#__PURE__*/ (() => {
return {
onPageScroll: 1,
onShareAppMessage: 1 << 1,
onShareTimeline: 1 << 2,
} as const
})()
export const EventOptionFlags = {
capture: 1,
once: 1 << 1,
passive: 1 << 2,
}
export const EventOptionFlags = /*#__PURE__*/ (() => {
return {
capture: 1,
once: 1 << 1,
passive: 1 << 2,
}
})()
export function encodeOptions(options?: AddEventListenerOptions) {
let flag = 0
......@@ -20,11 +22,13 @@ export function encodeOptions(options?: AddEventListenerOptions) {
return flag
}
export const EventModifierFlags = {
stop: 1,
prevent: 1 << 1,
self: 1 << 2,
}
export const EventModifierFlags = /*#__PURE__*/ (() => {
return {
stop: 1,
prevent: 1 << 1,
self: 1 << 2,
}
})()
export function encodeModifier(modifiers: string[]) {
let flag = 0
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册