JSFiddle - React, Tailwind, and code Playground

by zerkms

JavaScript

function firstAjax() {
    return $.ajax({
        url: '/echo/json/',
        type: 'post',
        data: { json: '{"id": 42 }', delay: 2 },
        success: function() { console.log('first'); }
    });
};

function secondAjax() {
    return $.ajax({
        url: '/echo/json/',
        type: 'post',
        data: { json: '{"id": 42 }', delay: 2 },
        success: function() { console.log('second'); }
    });
};

firstAjax().pipe(secondAjax).done(function() {
    console.log('done');
});