Skip to content

Category: Questions

Passing pipeline item to promise argument in `takeUntil`

I have code with a similar control flow to this example (obviously, the predicate below doesn’t need to be async, but it’s an example): But this throws a TypeError with the message “You can provide an Observable, Promise, ReadableStream, Array, AsyncIterable, or Iterable.” I’ve t…

I want to reset value to initial value formik

I am getting some value from the backend and I am string in state and using throw formik what my task is I create reset onClick so like if I edit something but I don’t want to use it then if I click on reset onClick then it set to initial value and I create one state and update that

How to filter out an array of strings?

I’m trying to filter an array of objects where a certain key in the object contains an array of strings. Here’s an example of the data structure. let array = [{ tags: [“this is a tag”] }, …

detect outside table row click

How can I detect if a mouse click was not done on a table row? I created this table, which can be modified on the fly and highlights the selected row, if selected. Now I try to establish a function, which removes the row highlighting as soon as a mouse click was not done in one of those table rows.

useEffect on async operation

I’m a little confused when to use useEffect() the majority of the examples I see only use useEffect() to pull data from an API and other examples of side effects, but I haven’t seen people using …

populate select on page load

I’ve got it working for the first element, but as soon as i try to press another element it repopulates itself and selects the first element. HTML: Population: Necessary Information: I need to add the EventListener to every element of the NodeList as every Element is a select that needs to be populated.…