import { IDisposable } from "@fluidframework/common-definitions" ; export function doIfNotDisposed < T > ( disposable , f ) { return ( ... args ) => { if ( disposable . disposed ) { throw new Error ( "Already disposed" ) ; } else { return f ( ... args ) ; } } ; }