 LoaderMixin =
   statics: {Status}
   propTypes:
-    loader: PropTypes.func.isRequired
     src: PropTypes.string.isRequired
     priority: PropTypes.number
   contextTypes:

React = require 'react'
imageLoader = require 'queueup-imageloader'

{PropTypes} = React
{img} = React.DOM

Status =
  PENDING: 'pending'

    status: Status.PENDING
  componentDidMount: ->
    return unless @state.status is Status.PENDING
    if @context?.loadQueue?
      loader = (callback) =>
        @loadImage @props.src, callback
      loadResult = @context.loadQueue
        .enqueue loader, priority: @props.priority
      @setState {loadResult}
    else
      @loadImage @props.src
  componentWillReceiveProps: (nextProps) ->
    if nextProps.priority? and @state?.loadResult?
      @state.loadResult.priority nextProps.priority
