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

feat: tree-shaking with bitwise operation

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