Skip to content

Conversation

@brettz9
Copy link
Contributor

@brettz9 brettz9 commented Apr 13, 2016

Builds on top of the previous PR. Early callbacks will be run before the stores and indexes are added and deleted, allowing for such early callbacks to run idb-schema methods like addStore. This is needed by the idb-import project I am working on now, to allow specification of imports by JSON (without my needing to reinvent the wheel with your methods).

It is also needed because the other PR allows normal callbacks to execute, as before, after the other methods, but in a way which supports promises--by having them run during the success event instead of during upgradeneeded when schema.open or schema.upgrade are used (it wouldn't make sense to use them in schema.callback since that is automatically going to be within upgradeneeded); there should therefore also be a way to run a callback within the upgradeneeded transaction, e.g., to check the current object stores and conditionally add one if not present.

@brettz9 brettz9 force-pushed the addEarlyCallback branch 13 times, most recently from 1621e50 to 015d079 Compare April 17, 2016 02:05
@brettz9 brettz9 force-pushed the addEarlyCallback branch 2 times, most recently from 4ff1754 to 6e4a289 Compare April 22, 2016 02:56
@brettz9 brettz9 force-pushed the addEarlyCallback branch from 6e4a289 to b6e7457 Compare May 2, 2016 01:34
brettz9 added 2 commits May 1, 2016 19:12
…allow a sequence of upgrades which can support promises returned by `addCallback` callbacks (and add docs and tests for multiple promise-based callbacks on different versions);

Commenting: Indicate specific Safari bug within code;
Refactoring: Use ES6 `Array.from`; add `Number.isInteger` and ES7 `Object.values()` in place of npm modules (requires babel-polyfill);
Testing: Split off local testing from Sauce; prevent blocking; increase timeout for Firefox; add test to throw with previous version
…ted `addCallback` ones, can themselves use idb-schema methods (e.g., to convert from JSON to idb-schema) though, since they execute within `upgradeneeded` cannot support Promises (as can the callbacks within `addCallback` when `schema.open` or `schema.upgrade` are used); document
@brettz9 brettz9 force-pushed the addEarlyCallback branch from b6e7457 to 00abe5a Compare May 2, 2016 02:13
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant