REDROOM
PHP 8.2.30
Path:
Logout
Edit File
Size: 2.68 KB
Close
/proc/thread-self/root/home/byroehnu/.trash/node_modules11/react-redux/src/components/Provider.tsx
Text
Base64
import type { Context, ReactNode } from 'react' import * as React from 'react' import type { ReactReduxContextValue } from './Context' import { ReactReduxContext } from './Context' import { createSubscription } from '../utils/Subscription' import { useIsomorphicLayoutEffect } from '../utils/useIsomorphicLayoutEffect' import type { Action, AnyAction, Store } from 'redux' import type { CheckFrequency } from '../hooks/useSelector' export interface ProviderProps<A extends Action = AnyAction, S = unknown> { /** * The single Redux store in your application. */ store: Store<S, A> /** * An optional server state snapshot. Will be used during initial hydration render if available, to ensure that the UI output is consistent with the HTML generated on the server. */ serverState?: S /** * Optional context to be used internally in react-redux. Use React.createContext() to create a context to be used. * If this is used, you'll need to customize `connect` by supplying the same context provided to the Provider. * Initial value doesn't matter, as it is overwritten with the internal state of Provider. */ context?: Context<ReactReduxContextValue<S, A>> /** Global configuration for the `useSelector` stability check */ stabilityCheck?: CheckFrequency /** Global configuration for the `useSelector` no-op check */ noopCheck?: CheckFrequency children: ReactNode } function Provider<A extends Action = AnyAction, S = unknown>({ store, context, children, serverState, stabilityCheck = 'once', noopCheck = 'once', }: ProviderProps<A, S>) { const contextValue = React.useMemo(() => { const subscription = createSubscription(store) return { store, subscription, getServerState: serverState ? () => serverState : undefined, stabilityCheck, noopCheck, } }, [store, serverState, stabilityCheck, noopCheck]) const previousState = React.useMemo(() => store.getState(), [store]) useIsomorphicLayoutEffect(() => { const { subscription } = contextValue subscription.onStateChange = subscription.notifyNestedSubs subscription.trySubscribe() if (previousState !== store.getState()) { subscription.notifyNestedSubs() } return () => { subscription.tryUnsubscribe() subscription.onStateChange = undefined } }, [contextValue, previousState]) const Context = context || ReactReduxContext // @ts-ignore 'AnyAction' is assignable to the constraint of type 'A', but 'A' could be instantiated with a different subtype return <Context.Provider value={contextValue}>{children}</Context.Provider> } export default Provider
Save
Close
Exit & Reset
Text mode: syntax highlighting auto-detects file type.
Directory Contents
Dirs: 0 × Files: 3
Delete Selected
Select All
Select None
Sort:
Name
Size
Modified
Enable drag-to-move
Name
Size
Perms
Modified
Actions
connect.tsx
30.47 KB
lrw-r--r--
2026-02-28 00:30:14
Edit
Download
Rename
Chmod
Change Date
Delete
OK
Cancel
recursive
OK
Cancel
recursive
OK
Cancel
Context.ts
1.52 KB
lrw-r--r--
2026-02-28 00:29:44
Edit
Download
Rename
Chmod
Change Date
Delete
OK
Cancel
recursive
OK
Cancel
recursive
OK
Cancel
Provider.tsx
2.68 KB
lrw-r--r--
2026-02-28 00:30:14
Edit
Download
Rename
Chmod
Change Date
Delete
OK
Cancel
recursive
OK
Cancel
recursive
OK
Cancel
Zip Selected
If ZipArchive is unavailable, a
.tar
will be created (no compression).