3.0.0 • Published 9 years ago

fetch-once v3.0.0

Weekly downloads
1
License
ISC
Repository
github
Last release
9 years ago

Fetch-Once Circle CI

Ensure requests are only made once no matter how many times your application calls them, support custom cache lengths.

options

  • Supports all request options
{
    cache: true|false|int, // default: true
    successHandler: fn // For heavy processing of response only performed once
}

Example usage

// pendingRequests (singleton)
var requests = {};

// Component1.js
var fetchOnce = require('fetch-once');

fetchOnce(requests, {
    url: 'http://google.com'
}).then(function (data) {
    // use data in render
});

// Component2.js
var fetchOnce = require('fetch-once');

fetchOnce(requests, {
    url: 'http://google.com'
}).then(function (data) {
    // use data in render
});
3.0.0

9 years ago

2.0.0

9 years ago

1.1.0

9 years ago

1.0.2

9 years ago

1.0.1

9 years ago

1.0.0

9 years ago