This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| fetch('http://localhost:4000/generate', | |
| { | |
| method: "POST", | |
| headers: { | |
| "Content-type": "application/json; charset=UTF-8" | |
| }, | |
| body: JSON.stringify({a:1}) | |
| }) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| function createMe(config){ | |
| return { | |
| callMeString: function(){ | |
| console.log('who: ' + config); | |
| }, | |
| callMeObject: function(){ | |
| console.log('who: ' + (config && config.who)); | |
| } | |
| }; | |
| } |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| var getRejectedPromise = function(data){ | |
| if (typeof data !== 'undefined') { | |
| data = [].concat(data); | |
| } | |
| var deferred = new jQuery.Deferred(); | |
| deferred.reject.apply(deferred, data); | |
| return deferred.promise(); | |
| }; | |
| var getResolvedPromise = function(data){ |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| <!DOCTYPE html> | |
| <html> | |
| <head> | |
| <meta charset="utf-8"> | |
| <title>JS Bin</title> | |
| <style id="jsbin-css"> | |
| body { | |
| margin: 0; | |
| padding: 0; | |
| } |
NewerOlder