Nerdiest Political Manifesto
Learn about our RFC process, Open RFC meetings & more.Join in the discussion! »

kefir-jquery-ajax

1.0.2 • Public • Published

kefir-jquery-ajax

make a $.ajax request, get a kefir property back!

installation

npm install kefir-jquery-ajax

example usage

var kefirAjax = require('kefir-jquery-ajax')
 
//returns a promise for a GET to the query string
var queryOpts = function (date, number) {
   return {
    url: 'http://127.0.0.1:3000/sms',
    data: { 
      date: date, 
      number: number 
    }
  }
}
 
//returns a stream* from responses to query()'s AJAX request
var getData = function (date, number) {
  var responseStream = kefirAjax(queryOpts(date, "my-phone-number"))
  return responseStream.map(JSON.parse)
}
 
module.exports = getData

Install

npm i kefir-jquery-ajax

DownloadsWeekly Downloads

1

Version

1.0.2

License

MIT

Last publish

Collaborators

  • avatar