Skip to content

Commit 0975b59

Browse files
committed
Remove BusContext export
1 parent 7e484bd commit 0975b59

File tree

1 file changed

+2
-3
lines changed

1 file changed

+2
-3
lines changed

index.tsx

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -2,8 +2,7 @@ import React from 'react'
22
import mitt, { WildcardHandler, type Emitter, type EventType, type Handler } from 'mitt'
33

44
type Events = Record<EventType, unknown>
5-
export const BusContext = React.createContext<Emitter<Events> | null>(null)
6-
const P = BusContext.Provider
5+
const BusContext = React.createContext<Emitter<Events> | null>(null)
76

87
/** Return the event emitter. */
98
export function useBus () {
@@ -32,5 +31,5 @@ export function useListener (name: EventType, listener: Handler) {
3231
*/
3332
export function Provider ({ children }: { children: React.ReactNode }) {
3433
const [bus] = React.useState(() => mitt())
35-
return <P value={bus}>{children}</P>
34+
return <BusContext.Provider value={bus}>{children}</BusContext.Provider>
3635
}

0 commit comments

Comments
 (0)