import * as api from "../api" ; import { get , set } from "../immutable" ; export const toggleEvent = ( payload ) => ( state ) : Partial < api . State > => { const { runId , eventId } = payload ; const collapsed = get ( state . runsById , [ runId , "eventsById" , eventId , "collapsed" ] ) ; return { runsById : set ( state . runsById , [ runId , "eventsById" , eventId , "collapsed" ] , ! collapsed ) } ; } ;