-
Notifications
You must be signed in to change notification settings - Fork 1
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Hook or event when local database is created #116
Comments
Great idea! I can’t comment on whether to use an event or a hook, but either sounds fine to me. |
I wonder if there are other use cases than indexes for which we would want the hook. If it would only be for indexes, I could imagine a declarative way. Indeces would be relevant for both, client and server |
Maybe bootstraping some data? |
I’m currently thinking about a So to add custom data or views, you could then do hoodie.account.hook.before('bootstrap', function (options) {
return hoodie.store.add(myAppViews)
}) Would that work for you? |
|
Yes, that’s my thinking. Here the list of cases
|
This looks good. Thanks |
Local database is created on first page load, on sign in, and on sign out. It would be nice to have hook or event that would allow custom code to be performed when local database is created.
For example database indexes could be created at that time or some data could be bootstrapped.
Currently database is cleared in after 'signout' hook (of hoodie-client/init).
This make impossible to use
clear
event orsignout
hook to bootstrap new database. I have made an non working signout hook example on hoodie-app-tracker app.Currently to achieve running code is only possible when resolving
hoodie.account.signOut
as demonstrated in this commit: bmihelac/hoodie-app-tracker@d0974b3What do you think about emitting event
store.created
or adding hookhoodie.store.hook.after('database:create')
?The text was updated successfully, but these errors were encountered: