Skip to content
Discussion options

You must be logged in to vote

Atom params are indeed the Zedux equivalent of Recoil's atomFamily (and selectorFamily too, really, since all Zedux atoms can also be "selectors" by injecting any other atom).

There are a few approaches

Underscore-Prefix

We do exactly what you have in some places. We have the no-unused-vars eslint rule configured with "argsIgnorePattern": "^_" which makes eslint ignore underscore-prefixed vars

export const formAtom = atom('form', (_formId: string) => ...);

Use the Param

If you don't want that eslint rule, one thing I do in some side projects is export the id parameter:

export const formAtom = atom('form', (formId: string) => {
  const store = injectStore({});

  return api(store).setExports(

Replies: 2 comments 3 replies

Comment options

You must be logged in to vote
0 replies
Answer selected by erictompkins
Comment options

You must be logged in to vote
3 replies
@bowheart
Comment options

@erictompkins
Comment options

@bowheart
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