« first day (3905 days earlier)      last day (1026 days later) » 

12:24 AM
@ThiefMaster hey!
 
 
1 hour later…
user13780186
1:27 AM
hello devs. does anyone know how to display the other value of sizes then it will sum the same sizes stackblitz.com/edit/react-hook-zwgypv
 
11:22 AM
If I call an async call, let's say an endpoint to send an email, and .then() right after (not in the then, but literally right after) do window.location.href = "/whatever/route", will the email be sent? Basically will the promise be fulfilled on the other page or will it be forgotten? I want to send an email but immediately switch to another page and I don't want to do it after the promise is fullfilled cuz I dont want the user to wait the email delay
 
and what if the mail could not be sent? how are you informing the user ?
you can just send a request and proceed to the next page. When a request is made, it is made.
 
@KarelG Assume that's not a problem.
 
you don't have to wait for the promise
 
Hmm, I just tested with setTimeout and it seems not to work? I did setTimeout(() => console.log("foo1234"), 2000) and then right after I did window.location.href = '/some_url' and it redirected me to /some_url but foo1234 didn't get printed. Is that a valid test?
@KarelG oh so it's different with a request
 
@Silidrone that time out event object is in the memory of the previous page. That memory is gone when you're on another page
 
11:39 AM
@KarelG So the request has nothing to do with the memory of the previous page? I mean, how does the browser know how to successfully finish the request on the other page if the memory is wiped of the previous page where the request was made?
 
 
1 hour later…
12:50 PM
@KarelG Hmm.. is that documented somewhere? If I do an async request and instantly change the site after that I'd expect the browser to either fire&forget/cancel or skip the request depending on how it's implemented and how busy the browser is.
 
 
1 hour later…
2:15 PM
hey guys, you know how i convert this in number and not in string?
data: MesesOptions.map(
          month => [
            acc.find(
              x => x.name === 'Fuel'
            ).data[0] +
          (
            cur.mes === month.value
              ? month.value === 'NULL'
                ? parseInt(cur.Fuel)
                : cur.Fuel + cur.Fuel

              : cur.Fuel + 0 // false
          )
          ]
        )
      },
its returning String....
that parseInt was me trying to convert the string
 
2:41 PM
its supost to make like :
1061 + 0101 + 8193 + 6501
but the result come like
'1061010181936501'
 
3:08 PM
@NoobDEV-GBL you mean '1061 + 0101 + 8193 + 6501' (so a literal string with plus signs in it?)
 
no, its supost to sum the values
 
ah
use a Number construct to turn it into a real number
 
like this ya?
{
        name: 'Fuel',
        data: MesesOptions.map(
          month => [
            acc.find(
              x => x.name === 'Fuel'
            ).data[0] +
            (
              cur.mes === month.value
                ? month.value === 'NULL'
                  ? Number(cur.Fuel) // true
                  : Number(cur.Fuel) + Number(cur.Fuel)
                : Number(cur.Fuel) // false
            )
          ]
        )
      },
my console.log is like :
data: Array(12)
0: ["42122020181936501980377019545450203389202117461023…91137.620792755.121419347178771581673125317460852"]
have a working exemple of what i have here
 
I am developing a food delivery application.

What I want is whenever a user places an order I want to notify the shop owner about the order.

How do I achieve this.

Please Explain briefly.

PS. Iam using MERN stack
 
@ifzalkola Welcome to the JavaScript chat! Please review the room rules. If you have a question, just post it, and if anyone's free and interested they'll help. If you want to report an abusive user or a problem in this room, visit our meta.
 
3:23 PM
what do you mean by notify
 
like whenever the owner is online he should get a notification that new order is received
i just want to emit the message only to the owner
 
right, but, none of that is actionable
like, how would htey receive the notification?
an automated phone call? a text? a beeper? a phone app? a desktop app?
a bat signal?
2
 
just a push notification
 
🦇
 
I'd pay extra for a bat signal
 
3:31 PM
@ifzalkola that is not meaningful, you know
 
@ifzalkola on their phone? you need a mobile app for that
 
potentially 2
as you wouldn't want the customers to somehow through a bug get to the company bits of it
both could ofc share the same backend
 
you guys are taking it in a wrong way, I just want to recieve a message and may be console log it whenever an order gets placed in my shop
just for testing purpose
 
I would suggest beign a lot more specific. For example, what you seem to be asking is... "How do i send a push notification from node.js to react using socket.io"
which... is going to be a question that exists on SO already
 
how do you know he's using react?
because of that "MERN stack"?
(idk what that is lol)
/googles
 
3:37 PM
from the node server I want to emit an event like io.emit('new order') to the owner
 
> MongoDB, Express, React, Node
50% bad tech :D
 
Because they had a question on SO that is now deleted
it had a bit more info
 
I searched on SO for this but I didn't find any related solutions
 
@KarelG yeah i first heard about this lingo recently, MERN and MEAN
 
just pre-built "stacks" for node.js, and in some cases the client
kinda like... What was that PHP mysql stack?
wamp
xamp
 
3:42 PM
whomp
(you probably meant LAMP)
 
I just hate that mongodb has become the db most associated with node
 
LAMP was the linux version yes?
yeah... we had an app built using it, would not do it again
 
still prefer Linux over that MS server
not so fond of Windows Server stuff
 
me either
i never know where to put shit in windows
for hosting
 
4:31 PM
does someone know a small js repo that allows the following; you have an input text. When entering characters, you get a list of suggestions. It gets filtered with the current value. However it is allowed to have a different value than what the list provides
like [ ] with a list of countries. When writing "Ma" you get coutnries with starting "Ma" such as Malaysia. But you're allowed to enter "Mars" in that.
either in native js or as a jquery plugin
 
4:46 PM
@KarelG i've seen react libs that do that
 
5:25 PM
like... jquery ui's autocomplete?
 
6:04 PM
people still use jquery ui? :D
there's also native typeahead/autocomplete in browsers nowadays: developer.mozilla.org/en-US/docs/Web/HTML/Element/datalist
 
 
2 hours later…
8:11 PM
Does shifting a canvas's image around on the x / y axis change the pixel data of the rendered image?
 
@aeronaut Welcome to the JavaScript chat! Please review the room rules. If you have a question, just post it, and if anyone's free and interested they'll help. If you want to report an abusive user or a problem in this room, visit our meta.
 
 
2 hours later…
10:13 PM
 
11:10 PM
 

« first day (3905 days earlier)      last day (1026 days later) »