Skip to content

Commit

Permalink
Export UseDispatch type and organize exports
Browse files Browse the repository at this point in the history
  • Loading branch information
aryaemami59 committed Jan 5, 2024
1 parent 0e60aa7 commit 8f84eb9
Showing 1 changed file with 29 additions and 51 deletions.
80 changes: 29 additions & 51 deletions src/exports.ts
Original file line number Diff line number Diff line change
@@ -1,72 +1,50 @@
import Provider from './components/Provider'
import type { ProviderProps } from './components/Provider'
import connect from './components/connect'
import type {
export type {
Connect,
ConnectProps,
ConnectedProps,
} from './components/connect'
import type {
SelectorFactory,
Selector,
MapStateToProps,
MapStateToPropsFactory,
MapStateToPropsParam,
MapDispatchToPropsFunction,
MapDispatchToProps,
MapDispatchToPropsFactory,
MapDispatchToPropsParam,
MapDispatchToPropsNonObject,
MergeProps,
} from './connect/selectorFactory'
import { ReactReduxContext } from './components/Context'
import type { ReactReduxContextValue } from './components/Context'

import { useDispatch, createDispatchHook } from './hooks/useDispatch'
import { useSelector, createSelectorHook } from './hooks/useSelector'
import { useStore, createStoreHook } from './hooks/useStore'

import shallowEqual from './utils/shallowEqual'
import type { Subscription } from './utils/Subscription'

import { defaultNoopBatch } from './utils/batch'

export * from './types'
export { ReactReduxContext } from './components/Context'
export type { ReactReduxContextValue } from './components/Context'

export type { ProviderProps } from './components/Provider'
import Provider from './components/Provider'

export type {
ProviderProps,
SelectorFactory,
Selector,
MapStateToProps,
MapStateToPropsFactory,
MapStateToPropsParam,
Connect,
ConnectProps,
ConnectedProps,
MapDispatchToPropsFunction,
MapDispatchToProps,
MapDispatchToPropsFactory,
MapDispatchToPropsParam,
MapDispatchToPropsFunction,
MapDispatchToPropsNonObject,
MapDispatchToPropsParam,
MapStateToProps,
MapStateToPropsFactory,
MapStateToPropsParam,
MergeProps,
ReactReduxContextValue,
Subscription,
}
Selector,
SelectorFactory,
} from './connect/selectorFactory'

export { createDispatchHook, useDispatch } from './hooks/useDispatch'
export type { UseDispatch } from './hooks/useDispatch'

export { createSelectorHook, useSelector } from './hooks/useSelector'
export type { UseSelector } from './hooks/useSelector'

export { createStoreHook, useStore } from './hooks/useStore'

export type { Subscription } from './utils/Subscription'

export * from './types'

/**
* @deprecated As of React 18, batching is enabled by default for ReactDOM and React Native.
* This is now a no-op that immediately runs the callback.
*/
const batch = defaultNoopBatch

export {
Provider,
ReactReduxContext,
connect,
useDispatch,
createDispatchHook,
useSelector,
createSelectorHook,
useStore,
createStoreHook,
shallowEqual,
batch,
}
export { Provider, batch, connect, shallowEqual }

0 comments on commit 8f84eb9

Please sign in to comment.