Origami Frontend Components & Services

Readme: o-fetch-jsonp

Client side fetch wrapper that fallbacks to JSONP

Client

Uses fetch, but fallbacks to a fetch-like interface using JSONP under the hood

Install

bower install -S o-fetch-jsonp

Usage

import fetchJsonp from 'o-fetch-jsonp';
const opts = {
    timeout: 1000
};
fetchJsonp('http://other.domain.com/foo', opts)
    .then(data => {
        ...
    });

Note: If using CommonJS modules,

const fetchJsonp = require('o-fetch-jsonp').default;

Where opts can take

Switch component view

GitHub Repository

Install o-fetch-jsonp

If using the Build Service, add o-fetch-jsonp@^2.0.6 to your script tag.

If running a Manual Build, run bower install --save "o-fetch-jsonp@^2.0.6".

Help & Support

o-fetch-jsonp is maintained directly by the Origami team. If you have any questions about o-fetch-jsonp or Origami in general, we are happy to help. 😊

Slack: #ft-origami
Email: origami.support@ft.com

Feedback / Issues

To report a bug or request features please create an issue on Github. For support or general feedback please get in touch 😊

Slack: #ft-origami
Email: origami.support@ft.com