Skip to content

Make observer and subject utils generic #97

Description

@AlexIchenskiy

It would be better to make observer and subject from observer.utils.ts to use generics instead of hard-coded types in their payload.

The current implementation provides an existing type IObserverDataPayload which is the mix of existing node data types that are then used by observers and subjects.
A possible better implementation would be to provide custom payload data types for nodes and edges and use them to create a shared payload that could be used to parametrize observers while retrieving data. It is still not perfect and requires a lot of type guards to be used but it is already much more future-proof.

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

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