23 lines
477 B
JavaScript
23 lines
477 B
JavaScript
import { useReduxContext } from './useReduxContext';
|
|
/**
|
|
* A hook to access the redux store.
|
|
*
|
|
* @returns {any} the redux store
|
|
*
|
|
* @example
|
|
*
|
|
* import React from 'react'
|
|
* import { useStore } from 'react-redux'
|
|
*
|
|
* export const ExampleComponent = () => {
|
|
* const store = useStore()
|
|
* return <div>{store.getState()}</div>
|
|
* }
|
|
*/
|
|
|
|
export function useStore() {
|
|
var _useReduxContext = useReduxContext(),
|
|
store = _useReduxContext.store;
|
|
|
|
return store;
|
|
} |