Skip to content

Commit 6fd8512

Browse files
committed
chore: add main file
1 parent e1f5230 commit 6fd8512

File tree

3 files changed

+6
-4
lines changed

3 files changed

+6
-4
lines changed

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
"name": "rxjs-hooks",
33
"version": "0.0.1",
44
"description": "React hooks for RxJS",
5-
"main": "index.js",
5+
"main": "esm/index.js",
66
"author": "LongYinan <lynweklm@gmail.com>",
77
"license": "MIT",
88
"scripts": {

src/index.ts

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
export * from './use-event-callback'
2+
export * from './use-observable'

src/use-event-callback.ts

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -17,13 +17,13 @@ export function useEventCallback<T, U = void>(
1717
useEffect(
1818
() => {
1919
const event$ = new Subject<SyntheticEvent<T>>()
20-
function clickCallback(e: SyntheticEvent<T>) {
20+
function eventCallback(e: SyntheticEvent<T>) {
2121
return event$.next(e)
2222
}
23-
setState([clickCallback, initialValue])
23+
setState([eventCallback, initialValue])
2424
const value$ = callback(event$)
2525
const subscription = value$.subscribe((value) => {
26-
setState([clickCallback, value])
26+
setState([eventCallback, value])
2727
})
2828
return () => subscription.unsubscribe()
2929
},

0 commit comments

Comments
 (0)