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

Make GraphQL subscriptions fire a redux action #775

Merged
merged 3 commits into from
Oct 15, 2016
Merged

Conversation

helfer
Copy link
Contributor

@helfer helfer commented Oct 15, 2016

TODO:

  • If this PR is a new feature, reference an issue where a consensus about the design was reached (not necessary for small changes)
  • Make sure all of the significant new logic is covered by tests
  • Rebase your changes on master so that they can be merged easily
  • Make sure all tests and linter rules pass
  • Update CHANGELOG.md with your change
  • Add your name and email to the AUTHORS file (optional)
  • If this was a change that affects the external API, update the docs and post a link to the PR in the discussion

Copy link
Contributor

@stubailo stubailo left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM, some responses to code comments

subscriptionId: subId,
extraReducers: this.getExtraReducers(),
});
// It's slightly awkward that the data for subscriptions doesn't come from the store.
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think this is more or less reasonable since subscriptions usually don't represent an updating data source. Or rather, whether or not it comes from the store depends on whether you are using a subscription in place of a polling query, or as an event source.

const clonedState = assign({}, previousState) as NormalizedCache;

// TODO REFACTOR: is writeResultToStore a good name for something that doesn't actually
// write to "the" store?
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

What do you mean, "it doesn't write to the store?"

@stubailo stubailo merged commit d27305a into master Oct 15, 2016
@stubailo stubailo deleted the subscriptions-api branch October 15, 2016 22:05
@github-actions github-actions bot locked as resolved and limited conversation to collaborators Feb 2, 2023
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants