grafana/public/app/core/utils/connectWithReduxStore.tsx
2018-10-23 16:00:04 +02:00

12 lines
348 B
TypeScript

import React from 'react';
import { connect } from 'react-redux';
import { store } from '../../store/configureStore';
export function connectWithStore(WrappedComponent, ...args) {
const ConnectedWrappedComponent = connect(...args)(WrappedComponent);
return props => {
return <ConnectedWrappedComponent {...props} store={store} />;
};
}