From 481cfa03d9bf271a205b99049a9d1601714c68f1 Mon Sep 17 00:00:00 2001 From: Gilad S Date: Sat, 3 Feb 2024 17:18:16 +0200 Subject: [PATCH] feat(minor): improve documentation --- .github/workflows/test.yml | 2 +- README.md | 12 ++++++++++++ 2 files changed, 13 insertions(+), 1 deletion(-) diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml index b5475ce..bf155cf 100644 --- a/.github/workflows/test.yml +++ b/.github/workflows/test.yml @@ -26,7 +26,7 @@ jobs: node-version: "18" - name: Install modules run: npm ci - - name: Run vite tests + - name: Run vitest tests run: npm run test:vitest -- --coverage --reporter=junit - name: Upload coverage uses: codecov/codecov-action@v2 diff --git a/README.md b/README.md index 21f29c9..1c8cac4 100644 --- a/README.md +++ b/README.md @@ -77,6 +77,18 @@ console.log("lock acquired"); activeLock.dispose(); ``` +### `waitForLockRelease` +Wait for a lock to be released for a given `scope` and `key`. + +```typescript +import {waitForLockRelease} from "lifecycle-utils"; + +const scope = {}; // can be a reference to any object you like + +await waitForLockRelease(scope, "myKey"); +console.log("lock is released"); +``` + ### `EventRelay` A simple event relay.