index.js
function ( h )
{ getData ( h, true )
  .then
  ( function ( data )
    { if ( h.readValue == data )
      { // same. ignore
      }
      else
      { // console.log ( `onChangedPath ( "${h.path}" ) ` )
        h.evalValue = null
        h.readValue = data
        // reload
        let callbacks = h.callbacks
        for ( let i = callbacks.length-1; i >= 0; --i )
        { let clbk = callbacks [ i ]
          clbk.handler ( h, clbk.callback )
        }
      }
    }
  )
}
function ( h )
{ getData ( h, true )
  .then
  ( function ( data )
    { if ( h.readValue == data )
      { // same. ignore
      }
      else
      { // console.log ( `onChangedPath ( "${h.path}" ) ` )
        h.evalValue = null
        h.readValue = data
        // reload
        let callbacks = h.callbacks
        for ( let i = callbacks.length-1; i >= 0; --i )
        { let clbk = callbacks [ i ]
          clbk.handler ( h, clbk.callback )
        }
      }
    }
  )
}
function ( h ) { getData ( h , true ) . then ( function ( data ) { if ( h . readValue == data ) { // same. ignore } else { // console.log ( `onChangedPath ( "${h.path}" ) ` ) h . evalValue = null h . readValue = data // reload let callbacks = h . callbacks for ( let i = callbacks . length - 1 ; i >= 0 ; -- i ) { let clbk = callbacks [ i ] clbk . handler ( h , clbk . callback ) } } } ) }
If we change 'onChangedPath' to not read file content to detect file changes, we need to change the HANDLERS to use getData and adapt cache code accordingly.
If we change onChangedPath to not read file content to detect file changes we need to change the HANDLERS to use getData and adapt cache code accordingly .