This example allows the user to experiment with the behavior of idb observers.
The user can create observers with all possible configuations and see the changes
and metadata they receive when doing indexedDB operations.
Try the following to exercise edge cases:
Add an observer for os1, and see how the initial state is empty
Click 'add' for os1, and see the changes. Notice how there is no transaction and there are no values.
Add an observer for os1, put "3,3" in the key range, and check the values checkbox
Notice the initial state for the second observer.
Click 'delete' for os1, and notice how the first observer received the changes but the second didn't
Click 'put' for os1, and notice the difference in the changes between the first and second observer.
You can also experiment with having an observer listen to multiple object stores.
Object Store Controls
These buttons do basic modification to the given object stores. Make changes before
creating an observer to see the observer record the initial state correctly, or make
changes after creating an observer to view what the observer sees.
Object Store 1 ('os1')
the objectStore.
elements 1, 2, 3
elements 2, 3, 4
elements 1, 2
All of the above in one transaction.
Object Store 2 ('os2')
the objectStore.
elements 1, 2, 3
elements 2, 3, 4
elements 1, 2
All of the above in one transaction.
All for both object stores in one transaction.
Observer Controls
Use this form to create observers:
Object stores to observe (comma separated, example: "os1"):
Key range (optional, inclusive, and applies only to first object store*, example: "3,4"):
Include transaction
Include values
* for demo simplicity
Observers
Page Log
These examples show a prototype of IndexedDB observers.