@rodlopez/clean-code
TypeScript icon, indicating that this package has built-in type declarations

3.0.9 • Public • Published

Getting Started

Usage

import { useRequest, AsyncRequestRender } from "@rodlopez/clean-code";

const Component = () => {
  const repository = new Repository();
  const request = useRequest<User>({
    method: repository.getUser(),
  });
  return (
    <AsyncRequestRender<User>
      state={state}
      RenderLoading={<div />}
      Render={(user) => <MyUserUIMock user={user} />}
      RenderError={(errorObject) => <MyErrorUIMock error={errorObject} />}
    />
  );
};

export default Component;

Documentation

See https://rodlopezdev.github.io/rodlopez-clean-code

Package Sidebar

Install

npm i @rodlopez/clean-code

Weekly Downloads

2

Version

3.0.9

License

ISC

Unpacked Size

2.29 MB

Total Files

152

Last publish

Collaborators

  • rodlopez