Skip to content

What is meant within the README of create-subscription by async limitations? Can it be clarified? #13186

Closed
@sebinsua

Description

@sebinsua

What is meant within the README.md of create-subscription by async limitations?

For full compatibility with asynchronous rendering, including both time-slicing and React Suspense, the suggested longer term solution is to move to one of the patterns described in the previous section.

The patterns described above are:

  • Redux/Flux stores should use the context API instead.
  • I/O subscriptions (e.g. notifications) that update infrequently should use simple-cache-provider instead.
  • Complex libraries like Relay/Apollo should manage subscriptions manually with the same techniques which this library uses under the hood (as referenced here) in a way that is most optimized for their library usage.

I don't think any of these suit our use case: a high performance WebSocket stream that produces price quotes which are rendered directly into components. The application domain is a realtime trading application for an investment bank I am consulting for.

Ideally, we want the price quotes to be passed straight into the component with as little ceremony as possible. This state will be transient, so:

  • I don't see why I need to use some kind of state management solution to store it somewhere.
  • I don't think I should need to use react#Context and to then pass the data down the tree, since I can just import the service wherever I want in my code and pass callbacks into this to begin receiving data. The latter seems simpler, with less ceremony and will make it easier to differentiate between different streams of price updates.

It seems to me that create-subscription is exactly what I need, however the comment about async limitations worries me. Is there something I'm missing? Could this be clarified in the README?

Is it because of priority? I think ideally we wish the price updates to be treated as if they are high priority, because we would prefer to decrease the likelihood of clients interacting with stale data.

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions