There is a function exported by a library that I am currently using:
export function read(
urlOrRequest: any,
success?: (data: any, response: any) => void,
error?: (error: Object) => void,
handler?: Handler,
httpClient?: Object,
metadata?: Object): any;
At the moment, my usage of this function looks like this:
var request =
{
headers: oHeaders,
requestUri: "http://odatasampleservices.azurewebsites.net/V4/OData/OData.svc/Products",
data: null,
};
var successFunction = function(data)
{
document.getElementById("simpleReadWithMetadata").innerHTML = JSON.stringify(data, undefined, 2);
};
var failFunction = function(err)
{
alert(JSON.stringify(err));
};
oData.read(request, successFunction, failFunction, null, null, metadata);
My query is whether it's possible to wrap this call using rxjs. I believe it can be done, but I'm not sure how to go about it... Any thoughts?