If we added async keyval to the browser, are you happy with: kv.get('counter').then(i => kv.set('counter', i++)) …racing across processes?
-
-
Replying to @jaffathecake
Kinda yes. Promisified IDB is a good step forward but only helps in so much as fewer LOC to implem async keyval libraries.
1 reply 0 retweets 2 likes -
Replying to @addyosmani @jaffathecake
counter not being reliably staying up to date with writes is what would lean me more in the no camp sadly :/
1 reply 0 retweets 2 likes -
Replying to @addyosmani
same. And as you add transactions to make it safe… you may as well use IDB.
1 reply 0 retweets 3 likes -
Replying to @jaffathecake @addyosmani
There are plenty of "write-once read-mostly" use cases where this simple key/val API would be useful.
2 replies 0 retweets 3 likes -
Replying to @wanderview @addyosmani
yeah, it'd be fine most of the time, but I worry about cases like the counter catching people out.
2 replies 0 retweets 1 like -
what is the use case for the counter that means this would fail? Struggling to see problem.
1 reply 0 retweets 0 likes -
Replying to @gauntface
Tab 1 reads counter as 5 Tab 2 reads counter as 5 Tab 1 writes counter as 6 Tab 2 writes counter as 6 Two "increments" become 1
2 replies 0 retweets 0 likes -
Replying to @jaffathecake @gauntface
"Two increments become 1" is the sexiest thing I've ever written
2 replies 0 retweets 10 likes
sounds like a Boyz II Men hit single
-
-
Bitz II Incrementz
0 replies 0 retweets 3 likesThanks. Twitter will use this to make your timeline better. UndoUndo
-
Loading seems to be taking a while.
Twitter may be over capacity or experiencing a momentary hiccup. Try again or visit Twitter Status for more information.
JavaScript, HTML, CSS, HTTP, performance, security, Bash, Unicode, i18n, macOS.