interface ComponentController {
$inject?: string[];
mapState: (state: any) => any;
new (...args: any[]);
}
function connectToStores(controller: ComponentController) {
return function ConnectedComponent($scope, $ngRedux, $injector) {
const unsubscribe = $ngRedux.connect(controller.mapState);
$injector.invoke(controller, this, { $scope });
$scope.$on('$destroy', unsubscribe);
};
}