Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

How use without React #44

Open
eportico opened this issue Oct 19, 2017 · 4 comments
Open

How use without React #44

eportico opened this issue Oct 19, 2017 · 4 comments

Comments

@eportico
Copy link

Hi,
I'm building a rethink server using your modules server, client and react to replace layer data in Meteor projects. I want use subscription to changefeeds and simple query, but without React. How I can use this module ? Could you give me a short example without react componet. I don't know how use Subscription Manager and QueryRequest.

thanks.

@mikemintz
Copy link
Owner

mikemintz commented Oct 19, 2017 via email

@eportico
Copy link
Author

Hi,
I know use with websocket client , but I want use the subscription manager and changefeed what you have developed in this respository. It's nice
Thanks

@mikemintz
Copy link
Owner

mikemintz commented Oct 19, 2017 via email

@eportico
Copy link
Author

eportico commented Oct 20, 2017

let options = {...};

  RethinkCLI.DefaultSession.connect(options);
  let q = new RethinkCLI.QueryRequest({
    query: r.table('sae_lines').filter(r.row('Status')('CalidadDesfase').gt(70)), // RethinkDB query
    changes: true,             // subscribe to realtime changefeed
    initial: [],               // return [] while loading
  });
  let res = new QueryResult(q.initial, q.transform);

  const subscriptionManager = RethinkCLI.DefaultSession._subscriptionManager;
  subscriptionManager.subscribe(component, q, res);

I don't know how use your classes to do a simple example of subscription with changefeed.
I would appreciate your help to understand the operation with your base classes.

regards

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants