Skip to main content

Listening to Last Comments

Getting Started

In this section, we will show you how to listening to all last feeds.

Prerequisites

  1. Busy Hour Account (Sign Up if you don't have one yet)
  2. Create a Busy Hour Project from the Dashboard/Projects
  3. Create a Busy Hour App from from the Dashboard/Apps
  4. Download Busy Hour App config file from from the Dashboard/Apps

Listen to Last Comments

To start listening to last feeds, you can use the listenToFeedComments functions from @busy-hour/web package. The function itself take the following properties:

PropertyTypeDescription
versionnumberThe version of the last message to listen to
userIdstring (optional)The user id of the feed that you want to listen to

Quick Example

src/main.tsx
import { listenToFeedComments } from '@busy-hour/web';

let lastComments = [];

// Listen to last comments
const unsubscribe = listenToFeedComments({
version: 1,
onFeedComments(comments) {
lastComments = comments;
},
});

// Remove the subscription
unsubscribe();