Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Make observer and subject utils generic #97

Open
AlexIchenskiy opened this issue Mar 18, 2024 · 0 comments
Open

Make observer and subject utils generic #97

AlexIchenskiy opened this issue Mar 18, 2024 · 0 comments

Comments

@AlexIchenskiy
Copy link

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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant