You're Invited:Meet the Socket Team at BlackHat and DEF CON in Las Vegas, Aug 4-6.RSVP
Socket
Book a DemoInstallSign in
Socket

bacon.jquery.ajax

Package Overview
Dependencies
Maintainers
1
Versions
3
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

bacon.jquery.ajax

A [bacon.js](https://github.com/baconjs/bacon.js) plugin containing jQuery Ajax methods from [bacon.jquery](https://github.com/baconjs/bacon.jquery)

0.1.1
latest
Source
npmnpm
Version published
Weekly downloads
9
200%
Maintainers
1
Weekly downloads
 
Created
Source

bacon.jquery.ajax

A bacon.js plugin containing jQuery Ajax methods from bacon.jquery

Not dependent on bacon.model

Install

If you're targeting to node.js, you can

npm install bacon.jquery.ajax

For bower users:

bower install bacon.jquery.ajax

AJAX

All the methods return an EventStream of AJAX results. AJAX errors are mapped into Error events in the stream.

Aborted requests are not sent into the error stream. If you want to have a stream that observes whether an AJAX request is running, use Bacon.awaiting. For example:

var searchParams = Bacon.once({ url: '/search', data: { query: 'apple' } })
var ajaxRequest = searchParams.ajax()
var requestRunning = searchParams.awaiting(ajaxRequest)
requestRunning.assign($('#ajaxSpinner'), 'toggle')

stream.ajax(fn)

Performs an AJAX request on each event of your stream, collating results in the result stream.

The source stream is expected to provide the parameters for the AJAX call.

var usernameRequest = username.map(function(un) { return { type: "get", url: "/usernameavailable/" + un } })
var usernameAvailable = usernameRequest.changes().ajax()

Bacon.$.ajax(params)

Performs an AJAX request and returns the results in an EventStream.

var results = Bacon.$.ajax("/get/results")

or

var results = Bacon.$.ajax({ url: "/get/results"})

Bacon.$.lazyAjax(params)

Like above, but performs the AJAX call lazily, i.e. not before it has a subscriber.

Bacon.$.ajaxGet(url, data, dataType)

Bacon.$.ajaxGetJSON(url, data)

Bacon.$.ajaxPost(url, data, dataType)

Bacon.$.ajaxGetScripts(url)

Keywords

bacon.js

FAQs

Package last updated on 22 Dec 2015

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts