Listening to Last Activity Feed
Getting Started
In this section, we will show you how to listening to all last feeds.
Prerequisites
- Busy Hour Account (Sign Up if you don't have one yet)
- Create a Busy Hour Project from the Dashboard/Projects
- Create a Busy Hour App from from the Dashboard/Apps
- Download Busy Hour App config file from from the Dashboard/Apps
Listen to Last Activity Feed
To start listening to last feeds, you can use the listenToLastFeeds
functions from @busy-hour/web
package. The function itself take the following properties:
Property | Type | Description |
---|---|---|
version | number | The version of the last message to listen to |
userId | string (optional) | The user id of the feed that you want to listen to |
Quick Example
src/main.tsx
import { listenToLastFeeds } from '@busy-hour/web';
let lastFeeds = [];
// Listen to last feeds
const unsubscribe = listenToLastFeeds({
version: 1,
onLastFeeds(feeds) {
lastFeeds = feeds;
},
});
// Remove the subscription
unsubscribe();