useEffect() for this.onMount() to the run fetchTodos() function but the docs state the following.createResource for data fetching, but there's a problem.createResource runs fetchTodos.fetchTodos queries the API and uses the setTodos setter to populate todos.fetchTodos returns response.data, which populates todosCollection but todosCollection is redundant because it never gets used.
So what's the right way to do this in Solid?
- Should I use onMount` in a case like this?