Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
lightweight generator/promise utility

Fetching latest commit…

Cannot retrieve the latest commit at this time

Failed to load latest commit information.
.gitignore
.jshintrc
.travis.yml
Readme.md
component.json
index.js
package.json
test.js

Readme.md

concur Build Status

lightweight generator/promise utility

Installation

$ npm install concur

or

$ component install nathan7/concur

Example

API

Concur(function*(...)) -> function(...)

Returns a wrapped function. It'll return a promise for the return value of the generator.

$('#button').click(Concur(function*() {
  var data = yield $.ajax(url)
  $('#result').html(data)
  var status = $('#status').html('Download complete.')
  yield status.fadeIn().promise()
  yield sleep(2000)
  status.fadeOut()
}))

Concur.run(function*())

Equivalent to Concur(fn)().

License

MIT

Bitdeli Badge

Something went wrong with that request. Please try again.