     className: 'auto-save'
     resource: null
     keyboardDelay: 10 * 1000
+    immediateDelay: 0
     resetDelay: 2 * 1000
 
   getInitialState: ->

      delay = if @state.saving?
        @props.keyboardDelay
      else
        0
      @saveResourceAfter delay

  saveResourceAfter: (delay) ->

    delay = if @isTextInput e.target
      @props.keyboardDelay
    else
      @props.immediateDelay
    @saveResourceAfter delay

  handleClick: (e) ->
    if e.target.tagName is 'BUTTON'
      e.persist()
      console?.log 'AutoSave::handleClick', e
      @saveResourceAfter @props.immediateDelay

  handleBlur: (e) ->
    if @isTextInput e.target
