React Native Thrift library.
RN-Thrift is based on thrift js implementation, but offers some more features:
- TBinaryProtocol, very useful for saving network payloads
- Modules, easier to maintain code
- Remove some useless code, such as jqRequest
npm install rn-thrift
const Thrift = require('rn-thrift');
const MyService = require('path/to/my/service');
const MyService_types = require('path/to/my/service/types');
const transport = new Thrift.TXHRTransport('/service/url');
const protocol = new Thrift.TBinaryProtocol(transport);
const client = new MyService.Client(protocol);
client.invokeSomeMethod('param', function (result) {
console.log('result is', result);
});
RN-Thrift uses PhantomJS to run all tests in local machine and travis CI, please install it referring to office docs.
npm install
karma start
MIT.