reactive-toolkit

1.0.2 • Public • Published

Reactive Toolkit

Reactive Toolkit is a collection of custom hooks for building React applications.

Install

npm install reactive-toolkit

useFetchRT

import useFetchRT from "reactive-toolkit";

function MyComponent() {
  const { data, isLoading, error } = useFetchRT(
    "https://jsonplaceholder.typicode.com/posts"
  );

  if (isLoading) {
    return <div>Loading...</div>;
  }

  if (error) {
    return <div>Error: {error}</div>;
  }

  return (
    <div>
      {data?.map((post) => (
        <div key={post.id}>
          <h2>{post.title}</h2>
          <p>{post.body}</p>
        </div>
      ))}
    </div>
  );
}
export default MyComponent;

License

The MIT License.

Package Sidebar

Install

npm i reactive-toolkit

Weekly Downloads

0

Version

1.0.2

License

MIT

Unpacked Size

3.7 kB

Total Files

5

Last publish

Collaborators

  • webvitalii