Open NickColley opened 8 years ago
I would re-initialise the PouchDB db instance in .clear()
as we do with .reset()
in https://github.com/hoodiehq/hoodie-client-store.
A problem I see is that we expose the db
instance at store.db
which will be replaced on clear, but we can add that information to the README with a "use at your own risk" note
strike that, I think we should no re-initialse anything on .clear()
, instead do what PouchDB itself does: become unusable :) so the user has to create another instance manually if they want to add data again
Could we rename clear to destroy to better reflect what's going on? That conflicts with PouchDB's api though, is it necessary to have the events firing for this use case?
yeah I don’t mind renaming that method to .destroy()
, and renaming the clear
event, too. We still need a clear
event in https://github.com/hoodiehq/hoodie-client-store, but that is out of scope here
We've got a skipped .clear test that was blocked on the fact that PouchDB does not reinitilize the database, but now downstream we've worked around this with a .reset method in https://github.com/hoodiehq/hoodie-client-store
What's the plan of action to fix this test? Some options: