Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

How to use asyncSelectorFamily? #15

Closed
vdanchenkov opened this issue Aug 30, 2020 · 1 comment
Closed

How to use asyncSelectorFamily? #15

vdanchenkov opened this issue Aug 30, 2020 · 1 comment

Comments

@vdanchenkov
Copy link

I think, according to docs it should be

let selectorFamily = Recoil.asyncSelectorFamily({
    key: "theKey",
    get: (arg) => ({get}) => Js.Promise.resolve("value derived from arg"),
  });

But it does no compile:

Error: This function expects too many arguments, it should have type
'a => Recoil.fn(Recoil.getValue(Js.Promise.t('b)))

@vdanchenkov
Copy link
Author

What I needed:

let selectorFamily = Recoil.asyncSelectorFamily({
    key: "theKey",
    get: (arg) => Fn(({get}) => Js.Promise.resolve("value derived from arg")),
  });

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant