import { State } from 'reducers' ; import { history } from './App.store' ; export const redirect = ( path ) => ( dispatch , getState ) => { if ( path . indexOf ( '$resetPasswordToken' ) >= 0 ) { const state = getState ( ) ; path = path . replace ( '$resetPasswordToken' , state . auth . resetPasswordToken as string ) ; } dispatch ( history . push ( path ) ) ; } ; export const RESET = 'RESET' ; export const reset = ( ) => ( dispatch ) => { dispatch ( { type : RESET , } ) ; } ; export const RESTORE = 'RESTORE' ; export const restore = ( ) => ( dispatch ) => { dispatch ( { type : RESTORE , } ) ; } ; export const RECAPTCHA_REQUEST = 'RECAPTCHA_REQUEST' ; export const recaptchaRequest = ( ) => ( dispatch ) => { dispatch ( { type : RECAPTCHA_REQUEST , } ) ; } ;