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
async function getTodosList() { | |
const response = await fetch('https://jsonplaceholder.typicode.com/todos'); //fetch es await function. Podemos llamarlo con await y esperará aquí | |
const data = await response.json(); //.json es método async, podemos llamarlo con await y esperará aquí. | |
return data; //el return lo hará cuando la línea anterior acabe, después de esperar la conversión a json de la response | |
} | |
async function countCompletedTodosTitleLength(){ | |
const todos = await getTodosList(); //Llamamos a getTodosList y esperamos aquí hasta que acabe. | |
console.log(todos |
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 Emitter = require('events').EventEmitter; | |
function E(emitter, options) { | |
this.emitter = emitter; | |
this.options = options; | |
} | |
E.create = function (options) { | |
var emitter = new Emitter(); |
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
ForceGPULoad = (function(){ | |
var renderer; | |
var scene; | |
var camera; | |
return { | |
buffer: function( object3D ){ | |
// push | |
var originalPosition = object3D.position.clone(); | |
object3D.position.set( 0,0,0 ); |