import { Dispatch } from 'redux' ; import { ActionType } from '../Types' ; let handled = false ; export const updateWindowIds = ( windowIds ) => ( { type : ActionType . UpdateWindowIds as ActionType . UpdateWindowIds , payload : { windowIds } } ) ; export const handleUpdateWindowIds = ( ) => ( dispatch ) => { if ( handled ) { return ; } handled = true ; window . myAPI . onUpdateWindowIds ( ( windowIds ) => dispatch ( updateWindowIds ( windowIds ) ) ) ; } ;