Skip to content
This repository was archived by the owner on Jan 31, 2023. It is now read-only.
This repository was archived by the owner on Jan 31, 2023. It is now read-only.

"QueryRenderer" #12

@fakenickels

Description

@fakenickels
[@react.component]
let make =
    (
      ~state: AsyncHook.state('a, 'e),
      ~refetch,
      ~renderLoader=() => <FullLoader />,
      ~children,
      (),
    ) => {
  switch (state) {
  // TODO figure out what to do better with Idle state
  | Idle
  | Loading => renderLoader()
  | Error(error) => <Oopsie error={Oopsie.convertError(error)} refetch />
  | Data(data) => children(data)
  };
};

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions