lockable-storage

Concurrency and locking for HTML5 localStorage

Usage no npm install needed!

<script type="module">
  import lockableStorage from 'https://cdn.skypack.dev/lockable-storage';
</script>

README

HTML5 Lockable Storage

Manage concurrency between browser tabs running independent processes by (a)synchronizing the localStorage resource.

This is the implementation by Benjamin Dumke-von der Ehe as posted in his 2012 article JavaScript concurrency and locking the HTML5 localStorage.

Install

bower install lockablestorage

or

  npm install lockable-storage

Usage

LockableStorage.lock('key', function () {
    // exclusive access to localStorage['key']
});