Jump to content
Main menu
Main menu
move to sidebar
hide
Navigation
Aphorismen
Applications
Business Economics & Admin.
My Computers
Cooking
Devices
Folders
Food
Hardware
Infos
Software Development
Sports
Operation Instructions
Todos
Test
Help
Glossary
Community portal
adaptions
Sidebar anpassen
Wiki RB4
Search
Search
Create account
Log in
Personal tools
Create account
Log in
Pages for logged out editors
learn more
Contributions
Talk
Editing
JavaScript/JScript
(section)
Page
Discussion
English
Read
Edit
View history
Toolbox
Tools
move to sidebar
hide
Actions
Read
Edit
View history
General
What links here
Related changes
Special pages
Page information
Warning:
You are not logged in. Your IP address will be publicly visible if you make any edits. If you
log in
or
create an account
, your edits will be attributed to your username, along with other benefits.
Anti-spam check. Do
not
fill this in!
===Promises=== The Promise object represents the eventual (irgendwann) completion (or failure) of an asynchronous operation and its resulting value. At their most basic, [https://web.dev/promises/ promises] are a bit like event listeners except: * A promise can only succeed or fail once. It cannot succeed or fail twice, neither can it switch from success to failure or vice versa. * If a promise has succeeded or failed and you later add a success/failure callback, the correct callback will be called, even though the event took place earlier. A promise can be: * '''fulfilled''' - The action relating to the promise succeeded * '''rejected''' - The action relating to the promise failed * '''pending''' - Hasn't fulfilled or rejected yet A promise is said to be '''settled''' if it is either fulfilled or rejected, but not pending. The eventual state of a pending promise can either be fulfilled with a value or rejected with a reason (error). When either of these options occur, the associated handlers queued up by a promise's then method are called: * The '''.then()''' method takes up to two arguments; the first argument is a callback function for the fulfilled case of the promise, and the second argument is a callback function for the rejected case. Each .then() returns a newly generated promise object The '''Promise.resolve()''' method "resolves" a given value to a Promise.
Summary:
Please note that all contributions to Wiki RB4 may be edited, altered, or removed by other contributors. If you do not want your writing to be edited mercilessly, then do not submit it here.
You are also promising us that you wrote this yourself, or copied it from a public domain or similar free resource (see
Uwe Heuer Wiki New:Copyrights
for details).
Do not submit copyrighted work without permission!
Cancel
Editing help
(opens in new window)
Toggle limited content width