# All files / src/wx-mini load.ts

33.33% Statements 4/12
100% Branches 0/0
0% Functions 0/4
33.33% Lines 4/12

Press n or j to go to the next uncovered block, b, p or k for the previous block.

    1
    2
    3
    4
    5
    6
    7
    8
    9
    10
    11
    12
    13
    14
    15
    16
    17
    18
    19
    20
    21
    22
    23
    24
    251x
    1x
    1x

    1x

     import { EVENTTYPES } from '@/common/constant'
    import { HandleWxConsoleEvents, HandleNetworkEvents, HandleWxEvents } from './handleWxEvents'
    import { addReplaceHandler, replaceApp, replacePage } from './replace'

    export function setupReplace() {
      replaceApp()
      replacePage()
      addReplaceHandler({
        callback: (data) => HandleWxEvents.handleRoute(data),
        type: EVENTTYPES.MINI_ROUTE
      })
      addReplaceHandler({
        callback: (data) => {
          HandleNetworkEvents.handleRequest(data)
        },
        type: EVENTTYPES.XHR
      })
      addReplaceHandler({
        callback: (data) => {
          HandleWxConsoleEvents.console(data)
        },
        type: EVENTTYPES.CONSOLE
      })
    }