Node example incorrect
phmasek opened this issue · comments
Philip Masek commented
Documentation says the following:
const o = require('odata');
// promise example
o('http://my.url')
.get('resource')
.then((data) => console.log(data));
however I receive an error copying the code:
TypeError: o is not a function
To get it to work I had to do the following:
const o = require('odata').o;
// promise example
o('http://my.url')
.get('resource')
.then((data) => console.log(data));
Jan Hommes commented
yes, you are right. We need to update the docs as well with the input in #96
Maybe like this:
const { o } = require('odata');
// promise example
o('http://my.url')
.get('resource')
.then((data) => console.log(data));
object destruction should work in the latest node versions, or?