feat(core): add useAsyncLock hook#381
Conversation
🦋 Changeset detectedLatest commit: ed78f03 The changes in this PR will be included in the next version bump. This PR includes changesets to release 1 package
Not sure what this means? Click here to learn what changesets are. Click here if you're a maintainer who wants to add another changeset to this PR |
|
Size Change: 0 B 🆕 Total Size: 0 B |
|
Hi @zztnrudzz13 — thank you for this contribution, it's really well put together! Named functions, a stable There's one design point I'd love your input on before we merge, plus a tiny doc note: 1. Reactivity of To be clear, the ref is absolutely the right call for the guard itself — switching to
2. A small doc suggestion Everything else (coverage, SSR, JSDoc) looks great. Happy to talk through the API direction on point 1 anytime — thanks again! |
Overview
useAsyncLock, a new core hook for preventing overlapping async work by skipping concurrent calls while a lock is held.runWithLock:{ status: 'executed', data }when work runs and{ status: 'blocked' }when a call is skipped.react-simplikit.Checklist
yarn run fixto format and lint the code and docs?yarn run test:coverageto make sure there is no uncovered line?