janhommes / o.js

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

Topic to consider on OHandler #150

Closed sksallaj82 closed 1 year ago

sksallaj82 commented 1 year ago

It'd be great if I could do this:

private handler = OHandler;
construction(config: ODataConfig) {
    this.handler = o(this.config.rootUrl, this.config)
}

so that I could later do this

public makeRequest () {
    let a = this.handler.get('resource')
}

but instead on this line this.handler = o(this.config.rootUrl, this.config) it says

Property 'prototype' is missing in type 'OHandler' but required in type 'typeof OHandler'

else it works as stated in the docs.

sksallaj82 commented 1 year ago

my bad, i was having a syntax issue

private handle = OHandler

should have been

private handle: OHandler