open-index/open-npm huggingface dataset:
npm package: @liquidcloudteam/pubsub
Description: Lightweight pub/sub library to provide real-time communication between Liquid apps and components
Latest version: 2.1.14

# `@liquidclouddev/pubsub`

Lightweight pub/sub library to provide real-time communication between Liquid apps and components.

## Usage

Install the dependency:

```bash
npm install @liquidclouddev/pubsub
```

```js
import { PubSub } from '@liquidclouddev/pubsub';

const pubsub = new PubSub();

pubsub.subscribe('my-topic', (data) => {
  console.log(data);
});

pubsub.publish('my-topic', { foo: 'bar' });
```