11import { Action } from "redux" ;
22import { Dispatch } from "redux" ;
33import { XCSpyState } from "reducers/spyReducer" ;
4- import { ThunkAction } from "redux-thunk" ;
54import { snapshot , snapshotAll } from "../core" ;
65
76export const SHOW_STATE_MACHINE_PROPERTIES = "SHOW_STATE_MACHINE_PROPERTIES " ;
@@ -19,8 +18,8 @@ export interface SetStateMachineIdAction extends Action {
1918 id : string ;
2019}
2120
22- export const showStateMachineProperties = ( component : string , stateMachine : string ) : ThunkAction < void , XCSpyState , void > => {
23- return ( dispatch : Dispatch < XCSpyState > , getState : ( ) => XCSpyState ) => {
21+ export const showStateMachineProperties = ( component : string , stateMachine : string ) : ( dispatch : Dispatch < Action < any > > , getState : ( ) => XCSpyState ) => void => {
22+ return ( dispatch : Dispatch < Action > , getState : ( ) => XCSpyState ) => {
2423 const componentProperties = getState ( ) . components . componentProperties ;
2524 const firstId = Object . keys ( componentProperties [ component ] . stateMachineProperties [ stateMachine ] ) [ 0 ] ;
2625 dispatch ( {
@@ -44,14 +43,14 @@ export const setStateMachineId = (id): SetStateMachineIdAction => {
4443 } ;
4544} ;
4645
47- export const snapshotAction = ( currentComponent : string , stateMachine : string ) : ThunkAction < void , XCSpyState , void > => {
48- return ( dispatch : Dispatch < XCSpyState > ) : void => {
46+ export const snapshotAction = ( currentComponent : string , stateMachine : string ) : ( dispatch : Dispatch < Action < any > > , getState : ( ) => XCSpyState ) => void => {
47+ return ( dispatch : Dispatch < Action > ) : void => {
4948 snapshot ( dispatch , currentComponent , stateMachine ) ;
5049 } ;
5150} ;
5251
53- export const snapshotAllAction = ( currentComponent : string , stateMachines : string [ ] ) : ThunkAction < void , XCSpyState , void > => {
54- return ( dispatch : Dispatch < XCSpyState > ) : void => {
52+ export const snapshotAllAction = ( currentComponent : string , stateMachines : string [ ] ) : ( dispatch : Dispatch < Action < any > > , getState : ( ) => XCSpyState ) => void => {
53+ return ( dispatch : Dispatch < Action > ) : void => {
5554 snapshotAll ( dispatch , currentComponent , stateMachines ) ;
5655 } ;
5756} ;
0 commit comments