Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

chore: add badges to readme, fix failed test #5

Merged
merged 4 commits into from
Dec 13, 2022
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
12 changes: 12 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,17 @@
# useBetterEffect

[![npm version](https://img.shields.io/npm/v/use-better-effect.svg)][npm_url]
[![downloads](https://img.shields.io/npm/dt/use-better-effect.svg)][npm_url]
![license](https://img.shields.io/npm/l/use-better-effect.svg)
![size](https://img.shields.io/bundlephobia/minzip/use-better-effect)

[![Coverage Status](https://coveralls.io/repos/github/davidhu2000/use-better-effect/badge.svg?branch=main)](https://coveralls.io/github/davidhu2000/use-better-effect?branch=main)
![Dependency Count](https://badgen.net/bundlephobia/dependency-count/use-better-effect)
![Types Included](https://img.shields.io/npm/types/use-better-effect)
![Tree Shaking Supported](https://badgen.net/bundlephobia/tree-shaking/use-better-effect)

[npm_url]: https://www.npmjs.org/package/use-better-effect

A wrapper around `React.useEffect` but with improved API

## Installation
Expand Down
2 changes: 1 addition & 1 deletion src/use-better-effect.hook.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -97,7 +97,7 @@ describe("useBetterEffect", () => {
{ initialProps: { dependencies: [1, 2, 3] } }
);
expect(callbackFn).toHaveBeenCalledTimes(1);
rerender({ dependencies: [1, 2, 3, 4] });
rerender({ dependencies: [2, 3, 4] });
expect(callbackFn).toHaveBeenCalledTimes(2);
});

Expand Down