index.js
// wrap all listeners, but specifically those for 'change' and 'complete'
wrap all listeners, but specifically those for 'change' and 'complete'
wrap all listeners but specifically those for ' change ' and ' complete '
on (event, listener) {
          const origListener = listener
          if (event === 'change') {
            listener = async (change) => {
              origListener(await modifyChange(change))
            }
          } else if (event === 'complete') {
            listener = async (res) => {
              origListener(await modifyChanges(res))
            }
          }
          return origOn.call(changes, event, listener)
        }
on ( event , listener ) { const origListener = listener if ( event === 'change' ) { listener = async ( change ) => { origListener ( await modifyChange ( change ) ) } } else if ( event === 'complete' ) { listener = async ( res ) => { origListener ( await modifyChanges ( res ) ) } } return origOn . call ( changes , event , listener ) }
wrap all listeners, but specifically those for 'change' and 'complete'
wrap all listeners but specifically those for ' change ' and ' complete '
// the 'complete' event returns all relevant changes, // so we submit them all for transformation