1.0.2 • Published 1 year ago

reactive-toolkit v1.0.2

Weekly downloads
-
License
MIT
Repository
github
Last release
1 year ago

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.

1.0.2

1 year ago

1.0.1

1 year ago

1.0.0

1 year ago