Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Port entry point consolidation from 8.x branch #1811

Merged
merged 1 commit into from Sep 4, 2021
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
1 change: 1 addition & 0 deletions rollup.config.js
Expand Up @@ -27,6 +27,7 @@ const config = {
}),
replace({
'process.env.NODE_ENV': JSON.stringify(env),
preventAssignment: true,
}),
commonjs(),
],
Expand Down
25 changes: 4 additions & 21 deletions src/alternate-renderers.js
@@ -1,26 +1,9 @@
import Provider from './components/Provider'
import connectAdvanced from './components/connectAdvanced'
import { ReactReduxContext } from './components/Context'
import connect from './connect/connect'

import { useDispatch } from './hooks/useDispatch'
import { useSelector } from './hooks/useSelector'
import { useStore } from './hooks/useStore'
export * from './exports'

import { getBatch } from './utils/batch'
import shallowEqual from './utils/shallowEqual'

// For other renderers besides ReactDOM and React Native, use the default noop batch function
// For other renderers besides ReactDOM and React Native,
// use the default noop batch function
const batch = getBatch()

export {
Provider,
connectAdvanced,
ReactReduxContext,
connect,
batch,
useDispatch,
useSelector,
useStore,
shallowEqual,
}
export { batch }
24 changes: 24 additions & 0 deletions src/exports.js
@@ -0,0 +1,24 @@
import Provider from './components/Provider'
import connectAdvanced from './components/connectAdvanced'
import { ReactReduxContext } from './components/Context'
import connect from './connect/connect'

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

import shallowEqual from './utils/shallowEqual'

export {
Provider,
connectAdvanced,
ReactReduxContext,
connect,
useDispatch,
createDispatchHook,
useSelector,
createSelectorHook,
useStore,
createStoreHook,
shallowEqual,
}
29 changes: 5 additions & 24 deletions src/index.js
@@ -1,29 +1,10 @@
import Provider from './components/Provider'
import connectAdvanced from './components/connectAdvanced'
import { ReactReduxContext } from './components/Context'
import connect from './connect/connect'
export * from './exports'

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

import { setBatch } from './utils/batch'
import { unstable_batchedUpdates as batch } from './utils/reactBatchedUpdates'
import shallowEqual from './utils/shallowEqual'
import { setBatch } from './utils/batch'

// Enable batched updates in our subscriptions for use
// with standard React renderers (ReactDOM, React Native)
setBatch(batch)

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