Example doesn't work
ChuckJonas opened this issue · comments
Charlie Jonas commented
When I try to run the example on this project, I get the following error:
db.select.from.where is not a function
const DeepProxy = require('proxy-deep');
const db = new DeepProxy({}, {
get(target, path, receiver) {
return this.nest()
},
apply(target, thisArg, argList) {
return this.path;
}
})
console.log(db.select.from.where()) // outputs ['select', 'from', 'where']
I hope I'm doing something wrong, as this is pretty much exactly what I need for my usecase!
Sam Vervaeck commented
Hi, sorry for not responding sooner. This seems to be a bug in the example, not in the library. The call to nest
should have gotten an anonymous function as argument, so that JavaScript knows it is callable. I will fix it along with some other improvements.