Skip to content

Make observer and subject utils generic #97

@AlexIchenskiy

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.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions