@rodlopez/clean-code
v3.0.9
Published
Clean Code Toolkit
Downloads
64
Maintainers
Readme
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;