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

Improve typings for channel presence state #236

Open
agubler opened this issue Mar 29, 2023 · 0 comments
Open

Improve typings for channel presence state #236

agubler opened this issue Mar 29, 2023 · 0 comments

Comments

@agubler
Copy link
Contributor

agubler commented Mar 29, 2023

Chore

Describe the chore

A user can pass custom state properties via the presence API and since #224 it is now possible to pass a generic that will adjust the types accordingly.

channel.presenceState<MyPresenceState>();

However it would be useful if we could stamp the presence types on creation of the channel

const channel = client.channel<MyPresenceState>('id', config);

// would enforce track to `MyPresenceState`
channel.track({ ... });

// return presence state as `MyPresenceState`
const presenceState = channel.presenceState();

Additional context

Please let me know if this is more than a chore and needs to be recorded elsewhere.

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