janhommes / o.js

o.js - client side oData lib.
https://janhommes.github.io/o.js/example/
MIT License
240 stars 58 forks source link

Not working on NativeScript #72

Closed Abenezer closed 6 years ago

Abenezer commented 6 years ago

throws n.on is not a function error.

i dont know if this plugin is wired only to work on browsers or if it has such dependencies . or should i use Nodify

janhommes commented 6 years ago

We use a wrapper which imitates xhr request in node. That might be the issue, because it tries to use browser xhr functions? Not sure how NativeScript works, but Nodify could be a way of doing it.

Abenezer commented 6 years ago

yeah i am trying to edited the file to use axios (http request plugin for javacript). since it works on node and browser it would be best if you use it too. or the best option will be to leave the implementation to the user (make the request service dynamic)

janhommes commented 6 years ago

agree, allow a dynamic request would be a good improvement. As this is open source, you can always start a PR to do so. When I used and wrote this, it was just planed for the browser. The node support comes through some ppl pointing me to the xhr2 lib.