janhommes / o.js

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

Chaining no longer possible with o.js #139

Closed codefoster closed 1 year ago

codefoster commented 2 years ago

I was lead to o.js by this blog post which shows that the calling pattern that o.js implements includes the ability to chain functions to compose a query. In looking at the documentation and codebase on GitHub, however, it appears this is no longer the case. Can you confirm this is the case? I can't see the value proposition of o.js if I have to pass in odata terms (i.e. $filter, $extend) much like I do when manually constructing an OData URL. Thank you!

janhommes commented 2 years ago

yeah we change the interface with 1.0.0. The blog post is based on some 0.4.x version.

However, chaining should still be possible. See for example this test: https://github.com/janhommes/o.js/blob/ef5d27e7ebdc5ca348ca1d61a110771dda50469a/src/o.spec.ts#L110-L113

Hope that helps.