1
0
mirror of https://github.com/robonen/tools.git synced 2026-03-20 10:54:44 +00:00

refactor(packages/vue): make getter param possible for useCached and useCounter

This commit is contained in:
2024-10-05 04:57:04 +07:00
parent 85fd7e34e0
commit 8822325299
4 changed files with 25 additions and 13 deletions

View File

@@ -13,6 +13,11 @@ describe('useCounter', () => {
expect(count.value).toBe(5);
});
it('initialize count with the provided initial value from a getter', () => {
const { count } = useCounter(() => 5);
expect(count.value).toBe(5);
});
it('increment count by 1 by default', () => {
const { count, increment } = useCounter(0);
increment();