Skip to content

Conditional fetch without atom #68

@ice-cap0

Description

@ice-cap0

hey !

this

const buildPostQuery =
  ({ id }: { id?: string }) =>
  () =>
    createFetcherStore<PostType>(id ? `posts.get?id=${id}` : [])

still fires!

from the docs:

if any atom value is either NoKey, we never call the fetcher—this is the conditional fetching technique we have;

is it really only atoms in key list that can prevent fetch (when NoKey)? can you not have any of the raw NoKey values

type NoKey = null | undefined | void | false;

to prevent fetch?

fwiw an enabled option would be awesome!

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions