!lxLFDpQJHZtqePeIUK:matrix.org

OS.js

180 Members
OS.js Matrix Channel (https://www.os-js.org/)30 Servers

Load older messages


SenderMessageTime
23 Sep 2020
@piterden:matrix.orgpiterden
In reply to @gitter_andersevenrud:matrix.org
You can't make a function async just by wrapping it in a Promise, if that's what you're thinking of.
Async means in consists of two functions
21:22:35
@gitter_andersevenrud:matrix.orgAnders Evenrud (Gitter)No, not really.21:22:47
@piterden:matrix.orgpiterdenYes, exactly like this21:23:06
@piterden:matrix.orgpiterdenWhen your mover is moving the window there can not be done some other work. Am I right?21:24:23
@piterden:matrix.orgpiterden * When your mover is moving the window there can not be done some other work. Am I right?21:24:46
@gitter_andersevenrud:matrix.orgAnders Evenrud (Gitter)I think you might be thinking of throttling or debouching and not async.21:29:29
@piterden:matrix.orgpiterdenPuppeteer API even a simple getting of property of some object, representing for example element on a page, is wrapped in promise21:30:40
@piterden:matrix.orgpiterden * Puppeteer API even a simple getting of property of some object, representing for example element on a page, wrapped in promise21:30:57
@piterden:matrix.orgpiterden * Puppeteer API even a simple getting of property of some object, representing for example element on a page, is wrapped in promise21:31:08
@gitter_andersevenrud:matrix.orgAnders Evenrud (Gitter) That's the thing... in Puppeteer, all of those interactions communicates with an underlying browser, which happens outside JavaScript -- which makes it a real async function. 21:31:43
@gitter_andersevenrud:matrix.orgAnders Evenrud (Gitter) As I said, just slapping a Promise on a function does not make it async. 21:32:41
@gitter_andersevenrud:matrix.orgAnders Evenrud (Gitter) It's the same as writing Promise.resolve(result), basically. 21:33:04
@piterden:matrix.orgpiterdenWhat is the difference between the real async and my proposed?21:33:47
@piterden:matrix.orgpiterdenWhat is async?21:34:37
@piterden:matrix.orgpiterden Callback->Promise->async/await 21:35:36
@piterden:matrix.orgpiterdenWe do need nothing excepting some task which takes a time to interact with asynchronous function calls.21:37:26
@piterden:matrix.orgpiterden * We do need nothing excepting some task which takes a time to interact with asynchronous function calls.21:38:06
@gitter_andersevenrud:matrix.orgAnders Evenrud (Gitter) All of those are basically the same. A callback has the signature (Error?, Result?), which a Promise also has, but in the form of a monad-like with rejected and resolved and supports chaining. And async/await is just syntastic sugar for using a Promise. 21:38:19
@piterden:matrix.orgpiterden A Promise is just a sugar for callback. 21:39:05
@piterden:matrix.orgpiterden * A Promise is just a sugar for callback. 21:39:11
@piterden:matrix.orgpiterdenI think mover can support animation in the future and you will anyway have to do it async )))21:42:42
@gitter_andersevenrud:matrix.orgAnders Evenrud (Gitter) Animations are supported, but I don't have that on movement. All of that stuff is handled in CSS only. 21:43:38
@gitter_andersevenrud:matrix.orgAnders Evenrud (Gitter)The DOM gets attributes that can be detected in the CSS to do stuff like that.21:44:17
@gitter_andersevenrud:matrix.orgAnders Evenrud (Gitter)Gotta go to bed. Cya!21:56:05
@piterden:matrix.orgpiterden
In reply to @gitter_andersevenrud:matrix.org
The DOM gets attributes that can be detected in the CSS to do stuff like that.
Okay, I am still just reading code and try to know your system better. It's a bit large honestly )
23:20:18
@piterden:matrix.orgpiterdenhttps://ash.ms/2019-02-19/vue-react-lifecycle-method-comparison/ lol23:51:19
25 Sep 2020
@pim:nltrix.netpim joined the room.11:01:43
26 Sep 2020
@georg:nitro.chatgeorg 08:09:42
@gitter_andersevenrud:matrix.orgAnders Evenrud (Gitter)

@piterden

It's a bit large honestly )

It's large-ish, heh.

20:09:54
27 Sep 2020
@tincho:matrix.valenciawireless.orgtincho joined the room.17:36:52

There are no newer messages yet.


Back to Room List