STATUS: Obsolete - see this updated proposal instead.
Extend IDBDatabase with:
interface IDBDatabase {
IDBExplicitTransaction explicitTransaction(scope, mode);
};
STATUS: Obsolete - see this updated proposal instead.
Extend IDBDatabase with:
interface IDBDatabase {
IDBExplicitTransaction explicitTransaction(scope, mode);
};
// http://cautionsingularityahead.blogspot.com/2012/07/resource-using-in-javascript.html | |
// Say you have a heavy-weight resource that you can explicitly finalize - either through | |
// some API or just by dropping a reference when you're done even if you want to hold onto | |
// the wrapper: | |
function Resource(a) { | |
var res = "a resource of " + a; | |
this.get = function() { | |
return res; |
#!/usr/bin/env bash | |
# Usage: | |
# echo -e "... $(text-style style ...) ..." | |
# echo -e "... $(text-reset) ..." | |
# echo -e "... $(text-color r g b) ..." | |
# echo -e "... $(background-color r g b) ..." | |
# | |
# Where: | |
# styles: |
This is a hacky prototype of what IDB-on-Promises could look like.
STATUS: See this updated proposal instead.
See also:
https://github.com/slightlyoff/Promises/tree/master/historical_interest/reworked_APIs/IndexedDB
// Copyright 2019 Google LLC. | |
// SPDX-License-Identifier: Apache-2.0 | |
var name = 'db' + Date.now(); | |
var openReq = indexedDB.open(name, 1); | |
openReq.onupgradeneeded = function() { | |
var db = openReq.result; | |
var store = db.createObjectStore('store'); | |
for (var i = 0; i < 100; i += 10) | |
store.put("record-" + i, i); |
// Copyright 2019 Google LLC. | |
// SPDX-License-Identifier: Apache-2.0 | |
// Basic p(r)olyfill for proposed feature | |
// This defines no successor of empty arrays, so the range for prefix | |
// [] or [[],[]] has no upper bound. | |
// An alternate definition would preclude adding additional nesting, | |
// so the range for prefix [] would have upper bound [[]] and the | |
// range for prefix [[], []] would have upper bound [[], [[]]]. |