-
-
Save debugmodedotnet/d62e0b4485e4147023900db533759bd4 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
searchId = signal<string>(this.searchTerm); | |
productResource = resource({ | |
params: () => ({ id: this.searchId() }), | |
loader: async (param) => { | |
const { id } = param.params as { id: string }; | |
console.log('Loading product with id:', id); | |
let a = await fetch(`http://localhost:3000/product/${id}`) | |
.then(response => response.json() as Promise<IProduct>) | |
console.log('Product fetched:', a); | |
return [a]; | |
} | |
}) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment