Skip to content

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

2 Commits
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Something that looks like a JavaScript Promise

import axios from "axios";
import Future from "./future/Future";

function main(): void {
  new Future<any>((resolve, reject) => {
    axios
      .get(`https://api.github.com/users/poorlydefinedbehaviour/repos`)
      .then(response => resolve(response))
      .catch(error => reject(error));
  })
    .then(response => response.data)
    .then(data => data[0].id)
    .then(id => console.log(`id => ${id}`))
    .catch(error => console.log("error", error));
}
main();

About

Promises implementation

Resources

Stars

Watchers

Forks

Releases

Packages

Used by

Contributors

Languages