howdyai / botkit-storage-mongo

A MongoDB storage driver for Botkit
MIT License
54 stars 42 forks source link

Simplified library code #9

Closed colestrode closed 8 years ago

colestrode commented 8 years ago

I simplified the main library and some of the unit tests. I removed duplicate code and extracted the storage object creation into a function.

Note that even though I updated some unit tests, they all passed after the refactoring.

ChrisCinelli commented 8 years ago

BTW, this logic should also go in the all other data stores and the memory store that comes with botkit. In general you want to have an abstraction at the type level instead that copied and pasted code for 3 times for each. Keep it DRY

colestrode commented 8 years ago

Good point @ChrisCinelli, though I think the idea is to just leave the file store in botkit and pull everything out as modules. I'm not sure when they're planning on doing that. Maybe I'll make a PR to clean all that up.

colestrode commented 8 years ago

@anonrig Since you merged #3, do you want to review and merge or close this PR before bumping the NPM version?

anonrig commented 8 years ago

Nice PR. :+1: