import { ResultTreeHandler } from './result-tree-handler' ; import { rgraphql } from 'rgraphql' ; export class ResultTreeNode { public children : ResultTreeNode [ ] = [ ] ; constructor ( public value ) { } public callHandler ( handler , cb ) { if ( ! handler ) { return ; } for ( let child of this . children ) { let nextHandler = handler ( child . value ) ; if ( nextHandler ) { cb ( child , nextHandler ) ; child . callHandler ( nextHandler , cb ) ; } } } }