Skip to content

delete get cache best practices? #742

Closed Answered by arthurfiorette
andrew2558 asked this question in Q&A
Discussion options

You must be logged in to vote

You could've tested it out... But yes, you have to provide different ID for each parameter, you can do something like:

const IDS = {
  getUserById: (id) => `get-user-by-id-${id}`,
  listUsers: 'list-users'
}

function getUserById(userId) {
  return axios.get(`url/${userId}`, { id: IDS.getUserById(userId), <other options> });
}

Replies: 1 comment 4 replies

Comment options

You must be logged in to vote
4 replies
@andrew2558
Comment options

@arthurfiorette
Comment options

Answer selected by andrew2558
@arthurfiorette
Comment options

@andrew2558
Comment options

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
2 participants