-
Notifications
You must be signed in to change notification settings - Fork 116
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
How to pass 'options' into the custom implementation of 'Store'? #27
Comments
ok, I see the problem... What do you think on having the "own implementation" as second argument? |
No, this is a bad idea, this will break the api of some other cqrs modules... but we could do something like: var es = require('eventstore')({
type: Store,
host: 'localhost'
}); |
I like it. Thank you! |
https://github.com/adrai/node-eventstore#own-db-implementation : Shouldn't it be MyDB instead of Store: var es = require('eventstore')({
type: Store
});
// es.init... |
Yes Il giorno 27-gen-2015, alle ore 23:52, nizachon <notifications@gh.neting.ccmailto:notifications@github.com> ha scritto: https://github.com/adrai/node-eventstore#own-db-implementation : Shouldn't it be MyDB instead of Store: var es = require('eventstore')({ Reply to this email directly or view it on GitHubhttps://github.com//issues/27#issuecomment-71746966. |
Adriano,
Following your instructions (https://github.com/adrai/node-eventstore#own-db-implementation), I was able to have EventStore use my own implementation of Store.
But after being a happy camper for a few days, now I don't see a way to pass options into my Store's (and also, EventStore's) constructor.
https://github.com/adrai/node-eventstore/blob/master/index.js#L7 :
https://github.com/adrai/node-eventstore/blob/master/index.js#L48https://github.com/adrai/node-eventstore/blob/master/index.js#L48 :
It appears that when using the custom Store implementation the way you recommend, what gets passed as options into the factory method and EventStore constructor, is the constructor of the custom Store. Then the same Store constructor gets called with itself as the value of options...
Am I missing something here?
Thanks,
-Leo
The text was updated successfully, but these errors were encountered: