promise

    0

    2

    lucycodes42

    JavaScript snippets for React

    Promise is an API and abstraction for asynchronous tasks. It allows you to make a statement like "I will do X when Y happens" without needing to use any expressions. This is a constructor for a new Promise object. The first argument is a function that takes two arguments: resolve and reject. The Promise will call this function when the promise is fulfilled or rejected.

    Shortcut: prom

    return new Promise((resolve, reject) => { first })
    Codiga Logo
    Codiga Hub
    • Rulesets
    • Explore
    • Cookbooks
    • Playground
    soc-2 icon

    We are SOC-2 Compliance Certified

    G2 high performer medal

    Codiga – All rights reserved 2022.