write.js
function (state, ev) {
    if(state.dirtyTs + 200 < ev.ts && state.queue) {
      state.cleanTs = ev.ts
      state.writing = true
      state.dirty = false
      return {state: state, effects: {type: 'write'}}
    }
    return state
  }
function (state, ev) {
    if(state.dirtyTs + 200 < ev.ts && state.queue) {
      state.cleanTs = ev.ts
      state.writing = true
      state.dirty = false
      return {state: state, effects: {type: 'write'}}
    }
    return state
  }
function ( state , ev ) { if ( state . dirtyTs + 200 < ev . ts && state . queue ) { state . cleanTs = ev . ts state . writing = true state . dirty = false return { state : state , effects : { type : 'write' } } } return state }
don't actually start writing immediately. incase writes are coming in fast... this will delay until they stop for 200 ms
don t actually start writing immediately . incase writes are coming in fast ... this will delay until they stop for 200 ms