!lxLFDpQJHZtqePeIUK:matrix.org

OS.js

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

Load older messages


SenderMessageTime
23 Sep 2020
@gitter_andersevenrud:matrix.orgAnders Evenrud (Gitter)If could be done with a higher order function ofc to make it look prettier though.20:56:26
@piterden:matrix.orgpiterdenCould you call the reason why one list of handlers definitions placed in root scope of a class but there are some definitions in inner scope of a class method?20:58:36
@piterden:matrix.orgpiterdenThings which would be lost after moving such definitions to the root scope are the side chain.21:00:20
@gitter_andersevenrud:matrix.orgAnders Evenrud (Gitter) Doing it that way makes it so you don't have to .bind() the mousemove and mouseup event handler methods. Also, there's no need to store a temporary variable for the window position/dimension on the class instance, just in a local scope. 21:06:11
@piterden:matrix.orgpiterdenOkay, I will make you to remember that in future... Also, generally, what about to move to promises api? 21:08:10
@gitter_andersevenrud:matrix.orgAnders Evenrud (Gitter) As I mentioned, making them into higher order functions will make the mousedown method much tinier (and makes it so the other events does not have to be instance methods -- because they're only used on a mousedown and discarded afterwards) 21:08:14
@gitter_andersevenrud:matrix.orgAnders Evenrud (Gitter)Move to Promises API?21:08:39
@piterden:matrix.orgpiterdenLike Puppeteer21:09:02
@piterden:matrix.orgpiterdenDid you use Puppeteer?21:09:19
@gitter_andersevenrud:matrix.orgAnders Evenrud (Gitter)What does this have to do with Puppeteer ?21:09:50
@piterden:matrix.orgpiterdenI ask had you ever used Puppeteer for automate Chrome?21:11:03
@gitter_andersevenrud:matrix.orgAnders Evenrud (Gitter) Well, first you asked something about moving to Promise, then Puppeteer. So I'm slightly confused, hehe. 21:11:32
@piterden:matrix.orgpiterdenPuppeteer has API based on Promises21:12:00
@gitter_andersevenrud:matrix.orgAnders Evenrud (Gitter) Yes, I've used Puppeteer. Most of the larger projects at work I maintain use that for end-to-end testing. 21:12:07
@piterden:matrix.orgpiterdenWhat do you think about its API?21:12:41
@gitter_andersevenrud:matrix.orgAnders Evenrud (Gitter)(and PDF generators and whatnot)21:12:51
@gitter_andersevenrud:matrix.orgAnders Evenrud (Gitter) It's pretty good. Straight-forward and easy to use. 21:13:33
@piterden:matrix.orgpiterden
In reply to @gitter_andersevenrud:matrix.org
(and PDF generators and whatnot)
NodeJS if useful for writing generators
21:13:58
@piterden:matrix.orgpiterden
In reply to @gitter_andersevenrud:matrix.org
It's pretty good. Straight-forward and easy to use.
Move to Promises I meant to make a similar API based on Promises
21:14:53
@piterden:matrix.orgpiterdenJust a proposal )21:15:26
@gitter_andersevenrud:matrix.orgAnders Evenrud (Gitter) If you're thinking of OS.js, all async API methods are Promises. 21:16:15
@piterden:matrix.orgpiterdenOh okay21:17:09
@piterden:matrix.orgpiterdenimage.png
Download image.png
21:19:19
@piterden:matrix.orgpiterdenI think mover should be async21:19:49
@gitter_andersevenrud:matrix.orgAnders Evenrud (Gitter) Images still don't work ;) 21:20:20
@piterden:matrix.orgpiterdenOh, sorry, I forget21:20:36
@gitter_andersevenrud:matrix.orgAnders Evenrud (Gitter) You can't make a function async just by wrapping it in a Promise, if that's what you're thinking of. 21:20:38
@piterden:matrix.orgpiterdenhttps://matrix-client.matrix.org/_matrix/media/r0/download/matrix.org/hxIGxIyeeLBQlgpLtjWaZYbJ21:21:05
@gitter_andersevenrud:matrix.orgAnders Evenrud (Gitter) The actual "async" part of something happens outside JavaScript itself (browser example: fetch() which is a browser API, node example: fs which is a C binding) 21:21:16
@gitter_andersevenrud:matrix.orgAnders Evenrud (Gitter) And in this case the events are fired with event listeners, which are signals, not really "async". 21:22:29

Show newer messages


Back to Room List