react-hooks
react-hooks copied to clipboard
Receive last message and history
A key feature of ably is to receive the last message, but the react hook do not expose the history. https://ably.com/docs/storage-history/storage#persist-last-message
➤ Automation for Jira commented:
The link to the corresponding Jira issue is https://ably.atlassian.net/browse/SDK-3892
Hey @mandymozart, thanks for reaching out!
You can use channel qualifier syntax to enable rewind on any channel, for example:
useChannel("[?rewind=100]your-channel-name")
If you need to use the channel history api you can do it by calling the history method on the channel instance returned by the hook, for example:
const [channel] = useChannel("your-channel-name");
const result = await channel.history(params);
Hope that clears things up, let me know if you have any further questions 🙂