reason-async-hook icon indicating copy to clipboard operation
reason-async-hook copied to clipboard

"QueryRenderer"

Open fakenickels opened this issue 4 years ago • 0 comments

[@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)
  };
};

fakenickels avatar Nov 27 '20 12:11 fakenickels