SolidJSS
SolidJS2y ago
32 replies
ChrisThornham

How Do I Update The createAsync() Signal?

I've been trying to use cache(), load(), and createAsync() because this pattern appears to be the preferred method for fetching data with SolidStart. Unfortunately, I can't figure out how to update the createAsync() signal.

When using createStore() you get access to a getter and a setter:

const [ getNotes, setNotes ] = createStore([]);


But when using createAsync() I only get access to a getter.

const notes = createAsync(() => getNotes());


How can I update the getter "notes" when using createAsync()?
Was this page helpful?