It looks like the underlying Monk api returns a promise, but that promise is not returned by the get function so we get beans === null.
How would people feel about changing table.findOne({id: id}, cb); to return table.findOne({id: id}, cb); in the get function and table.find({}, cb); to return table.find({}, cb); in the all function? This way plugin users can handle the promise themselves.
I can submit a pull request for this.
I realize there is a callback option...why not support both promises and callbacks?
Running the following example given in README.md, controller.storage.teams.get('cool') returns null
var beans = {id: 'cool', beans: ['pinto', 'garbanzo']}; controller.storage.teams.save(beans); beans = controller.storage.teams.get('cool');
It looks like the underlying Monk api returns a promise, but that promise is not returned by the get function so we get beans === null.
How would people feel about changing table.findOne({id: id}, cb); to return table.findOne({id: id}, cb); in the get function and table.find({}, cb); to return table.find({}, cb); in the all function? This way plugin users can handle the promise themselves.
I can submit a pull request for this.
I realize there is a callback option...why not support both promises and callbacks?