Skip to content

springuper/rn-thrift

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

7 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

RN-Thrift

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

Install

npm install rn-thrift

Usage

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);
});

Contribute

install PhantomJS

RN-Thrift uses PhantomJS to run all tests in local machine and travis CI, please install it referring to office docs.

install node modules

npm install

start karma

karma start

have fun~

License

MIT.

About

react native thrift library

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published