Skip to content

Subscription redundant wrapper #164

@Sam-Kruglov

Description

@Sam-Kruglov

See here

pubsub.publish("NUMBER_INCREMENTED", { numberIncremented: currentNumber });

This should be pubsub.publish("NUMBER_INCREMENTED", currentNumber) instead. The wrapper object contains the subscription name.

Also it would be good to have some sort of lightweight pubsub for testing. https://github.com/apollographql/graphql-subscriptions is too much for me and actually unusable because there's no built-in browser api, it uses node's events package which I don't have in the browser tests. I do happen to have rxjs, so I'm using that, I did have to pull in some async iterator converter though. And I also don't need the event name, I just want to publish the same type of event for this particular subscription.

Maybe rethink the api for subscription? Not even sure what the "resolve" method is for and having the underlying "subscribe" is unintuitive. Maybe just accept what subscribe accepts or just the pubsub api you come up with

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions