Is it possible to avoid getting results from cache when calling a function wrapped in lodash _.memoize()?
For example
import { memoize } from "lodash";
export const getUserPost = memoize(
async (userId, postId) => {
const postRef = firestore
.collection("posts")
.doc(userId)
.collection("userPosts")
.doc(postId);
const postDoc = await postRef.get();
...
return parseUserPost(postDoc);
},
(userId, postId) => `[${userId},${postId}]`
);
If I call getUserPost("raul", "postId") I will always be getting cached result if they are in cache...
Is it possible to use the memoize method with some kind of argument to get from the server instead?
Something like
getUserPost("raul", "postId", { cached: false });