Skip to content

A hook for when the subscribe/query is ready for the first time #860

@mitar

Description

@mitar

Is your feature request related to a problem? Please describe.

This is similar to #857, but slightly different. I am passing through route query string an ID of an object I want to highlight in the view. So after view is loaded, I query/subscribe to the data for many objects, and once data arrives, I have to then check the query string and update Vue state to highlight that object (I have to set Vuetify state to enable checkboxes). I can do that only after data is available to determine which object matches the ID and then do the rest.

I am using simple subscription for my subscribes, because this is how my GraphQL service (Hasura) provide live queries.

Describe the solution you'd like

I think onFirstResult() hook should be added next to result() existing hook, which would be called only the first time the subscribe returns.

Describe alternatives you've considered

Currently I have to add a flag on the component instance marking if result was already called or not and then process additional things the first time only. It is ugly and does not decouple things well.

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