« first day (3670 days earlier)      last day (1503 days later) » 

04:53
gud morning all
has anyone worked on cart functionality
 
1 hour later…
06:15
does reselect library essentially use top down DP (dynamic programing) to avoid recalculation of the 'slice' of the state?
@keemahs 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.
06:44
@BenjaminGruenbaum it's been many moons
 
2 hours later…
08:39
@keemahs lots of libraries do?
 
2 hours later…
10:41
hello all
anyone here
10:53
nope
@BenFortune
anyone worked with cart functionality
ionic
 
3 hours later…
13:32
We construct HTML strings in js, sometimes HTML attributes will be set with non-encoded values. Can this mistake be spotted by eslint custom rules? Can we create custom rules in eslint first of all?
@Wickie 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.
Someone who is familiar with eslint can ping here?
 
1 hour later…
14:53
Hey guys anybody able to assist with an issue of using preventdefault() conditionally?
dpaste.com/88XF9WWJ8 I have this ajax function that is submitting a load of forms with this loop on click of a separate form submission dpaste.com/656P5CVEZ what I am trying to do is change the variable 'allow' from true to false if I recieve an error within the ajax (note not ajax error but form validation error) ajax is still successful, however this is not changing thus it is not allowing me to finish submitting the form only if this is true
15:13
what are you doing inside send_attendance? This isn't python, you don't get named parameters in JS
unless you pass an object
I am sending these: dpaste.com/E7BVV6TME although seems to be sending the ajax alright?
Well yeah since it's sending the return value of those variable assignments
it's not the correct way to do it though
what is the correct way
to remove your variable assignments
if send_attendance are async calls then you're likely going to run into a bunch of race conditions too
hmmm how could I avoid the race conditions
as to the previous its best to do this:
send_attendance(st[i], lesson, 'attendance-' + i, i)
15:22
Aye
how would you avoid the race condition? also why is the variable allow changing within the send_attendance function but not where declared in the .submit()
Hi everybody! I want to do a webpack script who will gather all files with *.intl.ts to combine them to one file. Does anybody can give me advices on this?
15:54
Hello, can anyone help me please stackoverflow.com/questions/64647613/…
@CodeLover you should add more code and explain what you tried
eh, well, first off, you're returning a component... to a foreach callback
that doesn't do anything
secondly... is this an event handler?
is it expecting you to return a component that it will then do something with?
or did you just try it to see if it'd do anything
function PrintColours():
     colours = { "Red", "Green", "Blue", "Grey" }
     foreach colour in colours:
         print(colour)
if that was js
would colours be hoisted out the function?
well
it's not defined in the given code, so, depending on environment, it'd become a global
hi guys
16:05
there's no hoisting
as it's the first line
@KevinB is this directed to my problem?
No, it was directed to codelover
Your problem isn't a race condition
is there anyway to handle nextjs server client mismatch, I need random shades for a section. And shade is different in server client, thus causes the issue
for some reason, the one that isn't logging array[i] is incorrectly logging the title from within the for loop
at no point should that const overwrite what's outside
hmm do you know why the dpaste.com/88XF9WWJ8 allow variable there wouldn t be changing this as expected? dpaste.com/656P5CVEZ
16:08
Make sure they're all actually on the same version of node
it's certainly possible to have multiple versions of node installed
uh
allow IS being changed
you're just looking at it's value before it changes
you have to wait for all of the ajax requests to complete
hmm i thought that is what would happen when using a for loop the if statement would only be called after the success of the loop no?
or how would i get it to wait
success of the loop
but, the loop finishes long before any of the ajax requests
hmmm how could i get it to wait for these ajax requests
16:11
$.when
$.ajax returns a promise, pass each one as an argument to the same $.when to get a single promise that resolves when they're all done
any help?
noidea
@KevinB hmm let me try research how to do that
well, for anyone trying to solve the issue. using getServerSideProps worked for me.
 
1 hour later…
17:44
My service worker is supposed to return a cached page offline, but instead the default page is showing
@Reality 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.
and uhh, I think I have the right code
so
I have updated the code, please check and try. — Vimal Patel Oct 24 at 12:59
oops wrong link :(
0
A: Service worker not returning offline page is returning default page

Vimal PatelReplace your fetch event code with this one. For every request your fetch event will be invoked and it will check if your request is found in the cache file list then it will serve the file from there otherwise it will make the fetch call to get the file from server. self.addEventListener("fetch"...

can anyone help me out? I'm using localhost if that changes some things
 
1 hour later…
19:04
posted on November 02, 2020 by Prudhvikumar Bommana

The stable channel has been updated to 86.0.4240.183 for Windows, Mac & Linux which will roll out over the coming days/weeks. A list of all changes is available in the log. Interested in switching release channels?Find out how. If you find a new issue, please let us know by filing a bug. The community help forum is also a great place to reach out for help or learn about

19:54
@KevinB just a quick one is it possible to use the when() method with a for loop inside which dynamically states how many ajax calls to run?
for (var i = 0; i < studentcount ; i++) {
send_attendance(st[i], lesson, 'attendance-' + i, i)
}
essentially placing this in the when call?
 $.when
for (var i = 0; i < studentcount ; i++) {
send_attendance(st[i], lesson, 'attendance-' + i, i)
}).then(function() { if (allow == true){
                console.log('True')
            } else {
                console.log('False')
            }});
sort of like that
collect the promises in an array, then use that to call $.when
455
Q: Pass in an array of Deferreds to $.when()

adamjfordHere's an contrived example of what's going on: http://jsfiddle.net/adamjford/YNGcm/20/ HTML: <a href="#">Click me!</a> <div></div> JavaScript: function getSomeDeferredStuff() { var deferreds = []; var i = 1; for (i = 1; i <= 10; i++) { var count = i; deferreds....

@KevinB would i need to if in the end all i am checking for is the value of allow at the end of the ajax runs
19:58
does this chat cover service workers?
in theory
but i'm of no help there, so depends on if someone else is around
ok :(
@KevinB so even if i am only checking the end value i should still collet the promises
19:59
problem with school is that they block so many things it's like a getting through a brick wall when you try to ask for help with coding :(
If you need to know the end value to be able todo something, you need to know when the end value exists
the only way to do that is to know when they're all done
oh, you can do that with the typeof operator
if(typeof value === undefined){
   //do something here
}
alright thanks @KevinB for that link will look into how to implement a similar thing with mine
problem with that in his case is value doesn't exist yet
oh ok
20:02
it gets set when an array of http requests completes
yeah the value will only exist once all the calls return
just make an event listener, dispatch it when it's done, then when that event listener fires, check for the value (or some other method which is probably better than the one I gave)
Hi guys. I have a question about next.js and next-auth library. Do you know how to change JWT token payload to my custom one?
20:48
 
2 hours later…
user14475233
22:34
ummm
user14475233
i just got out of the question ban...
great
try not to get back into one

« first day (3670 days earlier)      last day (1503 days later) »