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

Other potential API updates #7

Closed
taion opened this issue Aug 19, 2016 · 8 comments
Closed

Other potential API updates #7

taion opened this issue Aug 19, 2016 · 8 comments

Comments

@taion
Copy link
Member

taion commented Aug 19, 2016

Just some thoughts, to bring things more closely in line with facebook/relay#1298:

@edvinerikson
Copy link
Member

add RelaySubscriptions.createContainer to make it available on props.relay

I am still not sure how that will be possible, do you have any small code-snippet that show it?

I like this, feels more integrated than the current API.
If you want to work on this, feel free to do so 👍

@taion
Copy link
Member Author

taion commented Aug 20, 2016

It'd essentially be

function createContainer(Component, config) {
  return Relay.createContainer(injectSubscribe(Component), config);
}

@edvinerikson
Copy link
Member

👍🏼 but that would still make us use subscriptions.subscribe, right?

On Saturday, 20 August 2016, Jimmy Jia notifications@github.com wrote:

It'd essentially be

function createContainer(Component, config) {
return Relay.createContainer(injectSubscribe(Component), config);
}


You are receiving this because you commented.
Reply to this email directly, view it on GitHub
#7 (comment),
or mute the thread
https://github.com/notifications/unsubscribe-auth/ADtdjKPv1IDXIpAno-UaByRBQtV18ZO_ks5qhyOXgaJpZM4Jo5Sq
.

@taion
Copy link
Member Author

taion commented Aug 20, 2016

I would actually make that call up to context.relay.subscribe, which would then delegate it to the network layer.

@edvinerikson
Copy link
Member

Hmm I see.. if we inject our HOC inside the Relay HOC we can hijack the props.relay object a little..

@taion
Copy link
Member Author

taion commented Aug 20, 2016

Yup exactly. It's one more HoC, but it saves having to make two separate wrapping HoC calls.

@edvinerikson
Copy link
Member

Yeah, sounds like a plan

@taion
Copy link
Member Author

taion commented Aug 22, 2016

2nd point in OP is handled in graphql-relay-subscription.

@taion taion closed this as completed Aug 24, 2016
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