import React from 'react' ; export const getRuntimeScope = ( { resultCallback , errorCallback , errorBoundary , } ) => { const $run = ( element ) => { if ( typeof element === 'undefined' ) { errorCallback ( new SyntaxError ( '`$run` must return valid JSX.' ) ) ; } else { try { resultCallback ( errorBoundary ( element ) ) ; } catch ( error ) { errorCallback ( error ) ; } } } ; return { $run } ; } ;