Bookworm
(12-14-2021, 10:40 PM)ryo Wrote: So I end up wrapping everything I make in Node into "promise.then.then.then.then..."

Just use async / await to avoid nesting callbacks Smile.

(12-14-2021, 10:40 PM)ryo Wrote: If I don't wrap everything into promises, thought process always goes like "WTF, I just solved this one bug only to create 5 new bugs!?" (refresh) "Oh, it got fixed by itself." (refresh) "NOW THERE ARE 20 NEW BUGS!?".

That doesn't sound right. Only a few things are asynchronous in Node.js like network requests and file operations (but those can be done synchronously too), because like you said async isn't always needed in programming. Asynchronous methods return promises and only with those you have to use .then or await if you want to do something after they complete.
  Reply


Messages In This Thread
Bookworm - by ragreenburg - 08-17-2021, 10:34 AM
Bookworm - by vongillus - 08-17-2021, 10:38 AM
RE: Bookworm - by ragreenburg - 08-17-2021, 10:41 AM
RE: Bookworm - by battlegarden - 08-18-2021, 06:21 AM
RE: Bookworm - by fernando_c_m - 08-18-2021, 06:57 AM
RE: Bookworm - by ragreenburg - 08-18-2021, 09:24 AM
RE: Bookworm - by battlegarden - 08-20-2021, 02:58 AM
RE: Bookworm - by ragreenburg - 08-20-2021, 01:37 PM
RE: Bookworm - by phoenixbyrd - 08-17-2021, 05:16 PM
RE: Bookworm - by bcnaz - 08-18-2021, 08:25 PM
RE: Bookworm - by vortex - 08-18-2021, 12:33 AM
Bookworm - by vongillus - 08-18-2021, 07:33 AM
RE: Bookworm - by Zebulon Walton - 08-18-2021, 06:43 PM
RE: Bookworm - by Zebulon Walton - 08-18-2021, 10:42 PM
RE: Bookworm - by bcnaz - 08-18-2021, 11:31 PM
RE: Bookworm - by fernando_c_m - 08-19-2021, 04:19 AM
RE: Bookworm - by Zebulon Walton - 08-19-2021, 07:13 AM
RE: Bookworm - by Zebulon Walton - 08-19-2021, 12:22 PM
RE: Bookworm - by Zebulon Walton - 08-20-2021, 06:14 AM
RE: Bookworm - by nelstomlinson - 08-20-2021, 11:42 AM
RE: Bookworm - by nelstomlinson - 08-20-2021, 12:53 PM
RE: Bookworm - by Zebulon Walton - 08-20-2021, 04:30 PM
RE: Bookworm - by bcnaz - 08-20-2021, 08:21 PM
RE: Bookworm - by Zebulon Walton - 08-21-2021, 12:37 PM
RE: Bookworm - by fernando_c_m - 08-22-2021, 01:45 PM
RE: Bookworm - by Zebulon Walton - 08-22-2021, 03:09 PM
RE: Bookworm - by fernando_c_m - 08-22-2021, 11:28 PM
RE: Bookworm - by bcnaz - 08-23-2021, 02:33 AM
RE: Bookworm - by Zebulon Walton - 08-23-2021, 08:06 AM
RE: Bookworm - by ragreenburg - 08-23-2021, 02:26 PM
RE: Bookworm - by fernando_c_m - 08-23-2021, 11:32 PM
RE: Bookworm - by Zebulon Walton - 08-23-2021, 02:37 PM
RE: Bookworm - by Zebulon Walton - 08-24-2021, 08:39 AM
RE: Bookworm - by bcnaz - 08-25-2021, 10:08 AM
RE: Bookworm - by henrythemouse - 08-26-2021, 01:36 PM
RE: Bookworm - by ragreenburg - 08-26-2021, 02:02 PM
RE: Bookworm - by bcnaz - 08-27-2021, 03:00 AM
RE: Bookworm - by ragreenburg - 08-27-2021, 09:40 AM
RE: Bookworm - by Zebulon Walton - 08-27-2021, 11:38 AM
RE: Bookworm - by TRS-80 - 08-27-2021, 06:20 PM
RE: Bookworm - by bcnaz - 08-27-2021, 08:16 PM
RE: Bookworm - by Zebulon Walton - 08-27-2021, 09:04 PM
RE: Bookworm - by bcnaz - 08-27-2021, 09:13 PM
RE: Bookworm - by TRS-80 - 08-28-2021, 04:08 PM
RE: Bookworm - by bcnaz - 08-29-2021, 11:46 PM
RE: Bookworm - by swiley - 08-30-2021, 08:39 AM
RE: Bookworm - by bcnaz - 08-30-2021, 11:32 AM
RE: Bookworm - by lsitongia - 09-02-2021, 12:55 PM
RE: Bookworm - by ragreenburg - 09-02-2021, 02:08 PM
RE: Bookworm - by bcnaz - 09-05-2021, 01:22 PM
RE: Bookworm - by Zebulon Walton - 09-10-2021, 06:56 AM
RE: Bookworm - by dante404 - 09-14-2021, 02:01 PM
RE: Bookworm - by bcnaz - 09-14-2021, 02:18 PM
RE: Bookworm - by Zebulon Walton - 09-14-2021, 02:56 PM
RE: Bookworm - by bcnaz - 09-14-2021, 05:31 PM
RE: Bookworm - by Zebulon Walton - 09-14-2021, 10:43 PM
RE: Bookworm - by ryo - 09-15-2021, 12:54 AM
RE: Bookworm - by hinton.s.b - 09-15-2021, 08:22 AM
RE: Bookworm - by ryo - 09-15-2021, 04:15 PM
RE: Bookworm - by ragreenburg - 09-16-2021, 02:12 PM
RE: Bookworm - by SocialNetworkingWasAMistake - 09-15-2021, 11:38 AM
RE: Bookworm - by ragreenburg - 09-15-2021, 11:41 AM
RE: Bookworm - by bcnaz - 09-16-2021, 03:25 PM
RE: Bookworm - by ryo - 09-18-2021, 09:19 AM
RE: Bookworm - by bcnaz - 09-18-2021, 10:15 AM
RE: Bookworm - by ryo - 09-20-2021, 06:29 AM
RE: Bookworm - by bcnaz - 09-20-2021, 12:02 AM
RE: Bookworm - by Zebulon Walton - 09-20-2021, 07:59 AM
RE: Bookworm - by bcnaz - 09-20-2021, 02:50 PM
RE: Bookworm - by ryo - 09-21-2021, 05:18 PM
RE: Bookworm - by bcnaz - 09-20-2021, 11:46 PM
RE: Bookworm - by ragreenburg - 09-21-2021, 08:32 AM
RE: Bookworm - by bcnaz - 09-21-2021, 12:09 PM
RE: Bookworm - by ragreenburg - 09-21-2021, 12:19 PM
RE: Bookworm - by bcnaz - 09-21-2021, 12:29 PM
RE: Bookworm - by ragreenburg - 09-21-2021, 12:46 PM
RE: Bookworm - by bcnaz - 09-21-2021, 02:32 PM
RE: Bookworm - by bcnaz - 09-22-2021, 02:52 PM
RE: Bookworm - by bcnaz - 09-23-2021, 03:16 AM
RE: Bookworm - by bcnaz - 09-24-2021, 10:01 PM
RE: Bookworm - by ragreenburg - 09-25-2021, 10:47 AM
RE: Bookworm - by Zebulon Walton - 09-25-2021, 06:49 AM
RE: Bookworm - by wibble - 09-25-2021, 09:31 AM
RE: Bookworm - by bcnaz - 09-25-2021, 02:01 PM
RE: Bookworm - by lasde - 09-28-2021, 12:26 PM
RE: Bookworm - by TRS-80 - 09-28-2021, 02:35 PM
RE: Bookworm - by bcnaz - 09-28-2021, 02:59 PM
RE: Bookworm - by bcnaz - 09-29-2021, 03:16 AM
RE: Bookworm - by Zebulon Walton - 09-29-2021, 08:37 AM
RE: Bookworm - by lsitongia - 09-29-2021, 10:30 AM
RE: Bookworm - by TRS-80 - 09-30-2021, 10:59 AM
RE: Bookworm - by bcnaz - 10-01-2021, 04:10 PM
RE: Bookworm - by juju - 10-02-2021, 08:04 AM
RE: Bookworm - by bcnaz - 10-19-2021, 01:16 AM
RE: Bookworm - by ragreenburg - 10-19-2021, 10:04 AM
RE: Bookworm - by bcnaz - 10-19-2021, 06:51 PM
RE: Bookworm - by SocialNetworkingWasAMistake - 10-20-2021, 04:50 AM
RE: Bookworm - by bcnaz - 10-29-2021, 04:25 AM
RE: Bookworm - by bcnaz - 11-10-2021, 12:36 AM
RE: Bookworm - by ragreenburg - 11-10-2021, 12:28 PM
RE: Bookworm - by bcnaz - 11-12-2021, 03:52 PM
RE: Bookworm - by quixote - 11-14-2021, 10:38 PM
RE: Bookworm - by bcnaz - 12-04-2021, 10:22 PM
RE: Bookworm - by beta-user - 12-05-2021, 09:08 AM
RE: Bookworm - by Zebulon Walton - 12-05-2021, 11:25 AM
RE: Bookworm - by bcnaz - 12-05-2021, 07:22 PM
RE: Bookworm - by bcnaz - 12-06-2021, 05:11 AM
RE: Bookworm - by beta-user - 12-07-2021, 06:28 AM
RE: Bookworm - by SocialNetworkingWasAMistake - 12-10-2021, 06:03 PM
RE: Bookworm - by ryo - 12-10-2021, 07:12 PM
RE: Bookworm - by SocialNetworkingWasAMistake - 12-10-2021, 07:22 PM
RE: Bookworm - by ryo - 12-11-2021, 06:28 PM
RE: Bookworm - by SocialNetworkingWasAMistake - 12-12-2021, 05:34 AM
RE: Bookworm - by guenther - 12-12-2021, 10:03 AM
RE: Bookworm - by beta-user - 12-13-2021, 06:42 AM
RE: Bookworm - by ragreenburg - 12-13-2021, 09:43 AM
RE: Bookworm - by ryo - 12-13-2021, 07:06 PM
RE: Bookworm - by ragreenburg - 12-14-2021, 09:49 AM
RE: Bookworm - by ryo - 12-14-2021, 10:40 PM
RE: Bookworm - by beta-user - 12-15-2021, 03:17 AM
RE: Bookworm - by ryo - 12-15-2021, 08:29 PM
RE: Bookworm - by bcnaz - 12-17-2021, 06:44 PM
RE: Bookworm - by bcnaz - 01-20-2022, 03:35 AM
RE: Bookworm - by ragreenburg - 01-20-2022, 09:38 AM
RE: Bookworm - by drh - 01-20-2022, 11:22 AM
RE: Bookworm - by bcnaz - 01-25-2022, 03:43 AM
RE: Bookworm - by user641 - 01-25-2022, 06:19 AM
RE: Bookworm - by bcnaz - 01-25-2022, 03:58 PM
RE: Bookworm - by bcnaz - 01-26-2022, 02:45 AM
RE: Bookworm - by beta-user - 01-26-2022, 05:29 AM
RE: Bookworm - by bcnaz - 02-01-2022, 01:50 AM
RE: Bookworm - by bcnaz - 01-26-2022, 07:54 PM
RE: Bookworm - by beta-user - 02-01-2022, 04:18 AM
RE: Bookworm - by ragreenburg - 02-01-2022, 09:28 AM
RE: Bookworm - by bcnaz - 02-02-2022, 01:26 AM
RE: Bookworm - by alanwake82 - 02-02-2022, 04:45 AM
RE: Bookworm - by bcnaz - 02-02-2022, 04:50 AM
RE: Bookworm - by bcnaz - 02-02-2022, 10:51 PM
RE: Bookworm - by vap0rtranz - 02-04-2022, 09:21 AM
RE: Bookworm - by Dinosaur1946 - 02-04-2022, 01:46 PM
RE: Bookworm - by ragreenburg - 02-04-2022, 02:42 PM
RE: Bookworm - by bcnaz - 02-04-2022, 08:01 PM
RE: Bookworm - by bcnaz - 02-06-2022, 05:04 AM
RE: Bookworm - by bcnaz - 02-06-2022, 09:02 AM
RE: Bookworm - by Dinosaur1946 - 02-06-2022, 02:01 PM
RE: Bookworm - by bcnaz - 02-07-2022, 12:55 AM
RE: Bookworm - by bcnaz - 02-09-2022, 06:58 PM
RE: Bookworm - by vusra - 02-10-2022, 01:06 AM
RE: Bookworm - by bcnaz - 02-10-2022, 01:42 AM
RE: Bookworm - by bcnaz - 02-16-2022, 02:14 AM
RE: Bookworm - by vap0rtranz - 02-16-2022, 06:40 AM
RE: Bookworm - by bcnaz - 02-23-2022, 02:59 AM
RE: Bookworm - by ragreenburg - 02-23-2022, 12:47 PM
RE: Bookworm - by bcnaz - 02-23-2022, 07:33 PM
RE: Bookworm - by ragreenburg - 02-24-2022, 09:32 AM
RE: Bookworm - by bcnaz - 02-25-2022, 11:10 PM
RE: Bookworm - by Hobbes42 - 02-26-2022, 07:50 AM
RE: Bookworm - by user641 - 02-26-2022, 10:33 AM
RE: Bookworm - by walter1950 - 02-27-2022, 09:12 AM
RE: Bookworm - by bcnaz - 02-27-2022, 04:18 AM
RE: Bookworm - by user641 - 02-27-2022, 08:57 AM
RE: Bookworm - by Hobbes42 - 02-27-2022, 03:23 PM
RE: Bookworm - by ragreenburg - 02-27-2022, 05:51 PM
RE: Bookworm - by Hobbes42 - 02-27-2022, 06:00 PM
RE: Bookworm - by ragreenburg - 02-27-2022, 07:37 PM
RE: Bookworm - by Hobbes42 - 03-19-2022, 01:10 PM
RE: Bookworm - by bcnaz - 03-19-2022, 02:46 PM
RE: Bookworm - by Hobbes42 - 03-19-2022, 05:30 PM
RE: Bookworm - by pFalken - 03-23-2022, 07:29 PM

Possibly Related Threads…
Thread Author Replies Views Last Post
  bookworm vs trixie discussion for mobian in pinephone regular. zetabeta 39 8,076 10-15-2024, 01:12 PM
Last Post: anonymous
  Problem with updates: Repository 'Debian bookworm' changed its 'non-free component' Anna 7 5,249 08-31-2023, 12:38 PM
Last Post: vusra
  Debian bookworm security repo user641 2 2,119 02-17-2023, 01:12 AM
Last Post: user641
  Bookworm Satellite Navigation biketool 7 4,384 09-02-2022, 01:42 PM
Last Post: vortex
  GPS/location services don't work with Maps after Bookworm upgrade Anna 16 12,583 06-13-2022, 02:37 PM
Last Post: wibble
  Bookworm Navigation Enabler Script biketool 2 2,022 06-02-2022, 04:12 AM
Last Post: biketool
  Flatpak on Bookworm biketool 0 1,132 05-25-2022, 03:47 PM
Last Post: biketool
  chatty v0.6 in Bookworm at last! treebeard 13 9,542 02-13-2022, 05:21 PM
Last Post: treebeard
  Waydroid Intallation on Bookworm Dinosaur1946 6 5,616 01-30-2022, 12:03 AM
Last Post: Dinosaur1946
  Safe to upgrade Bookworm again? nelstomlinson 2 2,970 10-12-2021, 03:45 AM
Last Post: bcnaz

Forum Jump:


Users browsing this thread: 8 Guest(s)