Revamp API wrapper code #10

Merged
alexliebowitz merged 5 commits from new-api-wrapper into master 2017-03-10 09:57:43 +01:00
Showing only changes of commit cba3ec3091 - Show all commits

View file

@ -57,13 +57,17 @@ jsonrpc.call = function (connectionString, method, params, callback, errorCallba
});
}
const counter = parseInt(sessionStorage.getItem('JSONRPCCounter') || 0);
xhr.open('POST', connectionString, true);
xhr.send(JSON.stringify({
'jsonrpc': '2.0',
'method': method,
'params': params,
'id': 0
'id': counter,
}));
sessionStorage.setItem('JSONRPCCounter', counter + 1);
};
export default jsonrpc;