MCPcopy Create free account
hub / github.com/Effect-TS/effect / on

Function on

packages/ui/native/src/NativeHttpClient.ts:125–132  ·  view source on GitHub ↗
(
    event: string,
    f: (exchange: Exchange, payload: Array<any>) => void
  )

Source from the content-addressed store, hash-verified

123const exchangesOf = perDevice((device) => {
124 const exchanges = new Map<number, Exchange>()
125 const on = (
126 event: string,
127 f: (exchange: Exchange, payload: Array<any>) => void
128 ) =>
129 device.on(event, (payload: Array<any>) => {
130 const exchange = exchanges.get(payload[0])
131 if (exchange !== undefined) f(exchange, payload)
132 })
133 on("didReceiveNetworkResponse", (exchange, payload) => {
134 exchange.head = payload
135 exchange.notify()

Callers 1

Calls 3

onMethod · 0.65
getMethod · 0.65
fFunction · 0.50

Tested by

no test coverage detected