1600963200
AKA a “fake” promise vs a “real” promise — explained in the context of Mongoose Queries
I was happily doing some backend coding and at the part where I had to write a mongoose query to return a list of items, I got confused at whether I should chain .exec()
or .then()
behind the myModel.find()
method. So I ended up searching their docs in an attempt to (try to) figure out which is the one I should use. Here’s a paragraph from their documentation:
Mongoose queries are not promises. They have a
.then()
function for co and async/await as a convenience. If you need a fully-fledged promise, use the.exec()
function.
At that moment I was like…what’s a “fully-fledged promise”? What does it even mean in this context?
And the journey of trying to figure out what that phrase means got me to this link and I found out that what they meant was that Mongoose queries are thenables and not promises. According to that link,
“promise” is an object or function with a
then
method whose behavior conforms to this specification.
“thenable” is an object or function that defines a
then
method.
Okay so naturally, the question now is — what does “whose behavior conforms to this specification” mean? To answer this question, let us take a closer look at what a “real” A.K.A “fully-fledged promise” means (and then we’ll look at why it’s different from thenables after that).
#programming #web-development #javascript
1590928341
Promise.allSetlled() is recently introduced in ECMA 2020.
Check out how it is different from Promise.all()
https://www.geekstutorialpoint.com/2020/05/promiseallsettled-vs-promiseall.html
#javascript #promise.all #promise.allsettled #ecma #promise #jquery
1608520601
Welcome to my post about the JavaScript Promises. I hope it can be helpful since when we start programming it is difficult to enter the context.
Promises are one of the largest tools in the world of JavaScript that helps us to manage future situations in the flow of execution of a program.
The promises originated in the realm of functional programming, generally to handle asynchronous programming. In short, they allow us to define how data that will only be available in the future will be treated, specifying what will be done with that data later.
The promises were introduced in the standard in ES6, the truth is that they have been used for a long time since several libraries had implemented them to solve their needs in a more elegant way.
The Promise object represents the eventual completion or failure of an asynchronous operation and its resulting value.
#programming #coding #javascript-promise #promises #javascript
1600963200
AKA a “fake” promise vs a “real” promise — explained in the context of Mongoose Queries
I was happily doing some backend coding and at the part where I had to write a mongoose query to return a list of items, I got confused at whether I should chain .exec()
or .then()
behind the myModel.find()
method. So I ended up searching their docs in an attempt to (try to) figure out which is the one I should use. Here’s a paragraph from their documentation:
Mongoose queries are not promises. They have a
.then()
function for co and async/await as a convenience. If you need a fully-fledged promise, use the.exec()
function.
At that moment I was like…what’s a “fully-fledged promise”? What does it even mean in this context?
And the journey of trying to figure out what that phrase means got me to this link and I found out that what they meant was that Mongoose queries are thenables and not promises. According to that link,
“promise” is an object or function with a
then
method whose behavior conforms to this specification.
“thenable” is an object or function that defines a
then
method.
Okay so naturally, the question now is — what does “whose behavior conforms to this specification” mean? To answer this question, let us take a closer look at what a “real” A.K.A “fully-fledged promise” means (and then we’ll look at why it’s different from thenables after that).
#programming #web-development #javascript
1588926410
In this vide, I explain new feature of JavaScript, more precisely - Promise APIs. Promise APIs consists of 4 functions:
This shall clear all your doubts regarding Promise APIs.
Please like, subscribe and comment on my channel EverydayJavaScript for more amazing videos.
#promise #es6 #javascript
1624245761
In this article, we’ll discuss information about the Promisetoken project and PROMISE token
Promise is the world’s first BEP20 token based on trust. Our token guarantees a continuously increasing price because everyone who holds the Promise token makes a promise to hold it for at least 15 days.Promise is a project driven by the community. This community consists of loyal people who are motivated to build a better future. Everyone in this community has one goal: to be part of this loyal and honest movement.
Trade
Promise tokens can be bought and sold on the decentralised trading platform Pancakeswap Trading takes place on the Binance Smart Chain (BSC) with the current trading pairs: BNB/PROMISE & ETH/PROMISE
Transparency
The Promise Smart Contract is verified and publicly viewable by all users on the Binance Smart Chain Explorer. All token balances and executed transactions & trades can be viewed on the Binance Smart Chain.
Vision
Steady growth through a 100% community driven token with deflationary characteristics. Development team burned all team tokens and participated in the launch fairly like anyone else. Limited circulating supply keeps the price high.
Measures
Half of the tokens were burnt at the start, with a further 2% being burnt with each subsequent transaction. Through the promise, users will cause a shortage of supply which will cause the price to rise rapidly. With an adjusted liquidity, the token will grow sustainably.
WHY PROMISE:
Promise is a project driven by the community. This community consists of loyal people who are motivated to build a better future.
Everyone in this community has one goal: to be part of this loyal and honest movement.
Become a part of this movement and achieve not only maximized profits but also exclusive benefits as a loyal partner of this community
SYMBOL: PROMISE
TOTAL SUPPLY: 1.000.000.000.000.000
BURNED: 500.000.000.000.000
DIGITS: 9
Burned: 500,000,000,000,000 | (50%)
Locked Pre-Sale Supply: 425,000,000,000,000| (42.75%)
Team Wallet: 50,000,000,000,000 | (5%)
Marketing: 25,000,000,000,000 | (2.25%)
Wall of Honor
All Promise Token holders that keep the promise of holding the token more than 15 days are listed here. The holders that hold the token the longest are praised here.
Wall of Shame
All Promise token holder who reswap their tokens to any other cryptocurrency within Coming Soon break their promise and will be presented here in the Wall of Shame.
Below you will find all frequently asked questions about the Promise Project. If you have any other questions, please get in touch.
What is Promise?
Promise is the world’s first BEP20 token based on trust. Our token guarantees a continuously increasing price because everyone who holds the Promise token makes a promise to hold it for at least 15 days. The longest holders will be honored with glory and shown on the top list of the Wall of Honor, while others who don’t keep their promise will end up on the Wall of Shame and be mocked by the community.
What is the utility of Promise?
The utility of Promise Tokens is like any other a means of value, which can be stored or transacted. The Promise Token runs on the Binance Smart Chain.
But there is a main function that has never been found in another project yet. The main function is keeping the value of each Promise Token increasing by making each buyer promise to hold the Token for at least 15 days. This keeps the supply low and the demand high.
What is the fee distribution?
Every transaction within the Promise smart contract applies a 4% fee, meaning buy and sell orders. Out of this, 2% will be automatically distributed to Promise Token holders. This serves as a reward for those people who keep the Promise the longest and support the project. The other 2% will be distributed to the Liquidity pool which leads to a higher price floor of Promise Tokens.
How many tokens will be burned?
50% of the total token supply has been burned already. In future, we will initiate further manual and controlled burns to keep the price high and ever-increasing. This way we can guarantee a scarcity of the tokens with an ever-increasing demand with our strategic marketing methods.
Why can’t I see the USD value on Trust Wallet?
In order for the USD value to be displayed on Trust Wallet, the Promise token must be listed on CoinMarketCap or CoinGecko. Only then Trust Wallet can pull the data using an API and display the USD value.
PROMISE token is now live on the Binance mainnet. The token address for PROMISE is 0xcbccf14b051947bdcd1e20b77015208a1ad5ea25. Be cautious not to purchase any other token with a smart contract different from this one (as this can be easily faked). We strongly advise to be vigilant and stay safe throughout the launch. Don’t let the excitement get the best of you.
Just be sure you have enough BNB in your wallet to cover the transaction fees.
Join To Get BNB (Binance Coin)! ☞ CLICK HERE
You will have to first buy one of the major cryptocurrencies, usually either Bitcoin (BTC), Ethereum (ETH), Tether (USDT), Binance (BNB)…
We will use Binance Exchange here as it is one of the largest crypto exchanges that accept fiat deposits.
Once you finished the KYC process. You will be asked to add a payment method. Here you can either choose to provide a credit/debit card or use a bank transfer, and buy one of the major cryptocurrencies, usually either Bitcoin (BTC), Ethereum (ETH), Tether (USDT), Binance (BNB)…
Step by Step Guide : What is Binance | How to Create an account on Binance (Updated 2021)
Next step
You need a wallet address to Connect to Pancakeswap Decentralized Exchange, we use Metamask wallet
If you don’t have a Metamask wallet, read this article and follow the steps
☞What is Metamask wallet | How to Create a wallet and Use
Transfer $BNB to your new Metamask wallet from your existing wallet
Next step
Connect Metamask Wallet to Pancakeswap Decentralized Exchange and Buy, Swap PROMISE token
Contract: 0xcbccf14b051947bdcd1e20b77015208a1ad5ea25
Read more: What is Pancakeswap | Beginner’s Guide on How to Use Pancakeswap
The top exchange for trading in PROMISE token is currently Pancakeswap v2
Find more information PROMISE
☞ Website ☞ Explorer ☞ Whitepaper ☞ Source Code ☞ Social Channel ☞ Social Channel 2 ☞ Coinmarketcap
🔺DISCLAIMER: The Information in the post isn’t financial advice, is intended FOR GENERAL INFORMATION PURPOSES ONLY. Trading Cryptocurrency is VERY risky. Make sure you understand these risks and that you are responsible for what you do with your money.
🔥 If you’re a beginner. I believe the article below will be useful to you ☞ What You Should Know Before Investing in Cryptocurrency - For Beginner
⭐ ⭐ ⭐The project is of interest to the community. Join to Get free ‘GEEK coin’ (GEEKCASH coin)!
☞ **-----https://geekcash.org-----**⭐ ⭐ ⭐
I hope this post will help you. Don’t forget to leave a like, comment and sharing it with others. Thank you!
#blockchain #bitcoin #promise #promisetoken