Closed nizachon closed 9 years ago
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@github.com<mailto: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')({ type: Store }); // es.init...
Reply to this email directly or view it on GitHubhttps://github.com/adrai/node-eventstore/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