I was making an app and had to fetch data from Realtime Database. I am getting the data in snapshot.val() like this And Now I want to access this data. When I am trying snapshot.val()[0].email and snapshot.val().[0].email I am Getting So, I am working in React Native and this is the code The nodes of database…
How to return data from Firestore query to a FlatList
I’m new to React-Native and I am trying to return the array of data from the firstore query to the device screen where I can setDevices. I had this working using .get() and .then(), but I wasn’t getting the updated events, so I’ve moved to onSnapshot and seem to have data at the query end, b…
How to use variables in dot notation like square bracket notation with variable depth
How can I access different JSON objects in JavaScript by a variable containing the attribute’s path? This notation represents only one hierarchic level per set of brackets, of course. Is there an easy elegant way to access several levels with only one labeling variable like “one.two” and …
How to provide type hints in JavaScript using JSDoc for Apollo Client based code?
I have trouble setting up type hints for my JavaScript code using JSDoc (trying to make this work with VSCode and WebStorm). As first step, I converted GraphQL schema into set of JSDoc @typedef entries using @graphql-codegen/cli. For the sake of this conversation, lets talk about this one: Then, somewhere in …
typing in two inputs using same keypad
i have an HTML and javasscript Keypad to typing Numbers into input using keypad im trying to add more inputs this keypad working good with only one input How i make my code javascript work with second input too when i focused on it the keypad should be able to typing in second input using same keypad? Answer …
How to change just one parameter using Redux?
I try to update my global state using Redux, but I try to update just one paramter of five, not all. My store code looks like: I tried to write a new case like, but doesn’t work: VS Code doesn’t let me write that “.activated” My dispatch look like: What is wrong? Answer I understand wh…
Cannot verify JWT – UnhandledPromiseRejectionWarning: JsonWebTokenError: jwt malformed
I have function that just send data to database (my posts). I use private and public keys to sign and verify tokens. I can send this token in header from front-end to back-end, but has problem with verifying it. Here is how this flow looks like: Front-end Back-end Middleware auth And JWT service The problem s…
How to properly refuse websocket upgrade request?
Sometimes I want to refuse a http client’s request to upgrade connection to websocket. Code (using go’s Gin and gorilla/websocket framework:) To allow upgrade: To refuse upgrade (due to invalid request params): Explaination: Here to refuse the upgrade I just return a http 400 code, then terminate …
Converting nested loops into forEach();
Im trying to learn forEach() method but i cant find more advanced examples. So i thought about refactoring my Codewars code to learn from it. I dont know know to properly use forEach method in nested loops. Hope You can help me learn from this example 🙂 6 kyu – Replace With Alphabet Position https://www…
(discord.js) Problem listing all the members
This function never returns anything. Can you help me? Answer As Cameron said in the comments you need to enable the GUILD_MEMBERS and the GUILDS intent from your Client constructer by listing it in the intents property of the Client Options like so