Files
30-seconds-of-code/node_modules/react-redux/es/hooks/useStore.js
2019-08-20 15:52:05 +02:00

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;
}