cefn / lauf

Monorepo for lauf packages.
MIT License
5 stars 0 forks source link

Write up lock example #147

Open cefn opened 3 years ago

cefn commented 3 years ago

The lock landing page should have a worked example, like this, and a further example using a key value...

const lock = createLock(); 
const unlock = await lock.acquire();
try{
  await doFirstThing()
  await doSecondThing()
}
finally{
  unlock()
}