python (12.9k questions)
javascript (9.2k questions)
reactjs (4.7k questions)
java (4.2k questions)
java (4.2k questions)
c# (3.5k questions)
c# (3.5k questions)
html (3.3k questions)
How to wrap multiple function with additional variables
Hi I have file like this
const logger = require("./logger");
const { asyncLocalStorage } = require("../localStorage/storage");
const getContextData = () => {
const roomName =...

Michał Bogusz
Votes: 0
Answers: 3
Ramda JS - Pass optional argument to the second function of a pipe
I am trying to refactor this code:
async function getUserDataByUsername(username, cached = true) {
const usernameRef = firestore
.collection("usernames")
.doc(username.toLowerCase(...

Raul
Votes: 0
Answers: 2
Get items from localStorage and export them
I have a function where it takes fields stored in state and returns them if they exist.
export const hasNameAndTokenSelector = (state) => {
const { fields } = baseInputsSelector(state);
c...
CodeG
Votes: 0
Answers: 2
Javascript refactroing series of if else statement
I have a method and attached an event listener like below.
This method looks ugly. Is there any other way to refactor?
Any suggestions or ideas would be appreciated.
document.querySelector('dateInput'...
jlc488
Votes: 0
Answers: 1