# hamrochat-snippet

> library to load messages in hamro chat

Latest version **1.0.5** (published 2023-11-27) · ISC license · 0 weekly downloads

## Install

```sh
npm install hamrochat-snippet
pnpm add hamrochat-snippet
yarn add hamrochat-snippet
bun add hamrochat-snippet
```

## Health

**Score 25/100 (F)** — status: abandoned.

Positive: has types; esm support; no vulnerabilities.

Warnings: low downloads.

Negative: abandoned; low maintenance score.

## Facts

| | |
|---|---|
| Version | 1.0.5 |
| Published | 2023-11-27 |
| First published | 2023-11-23 |
| Weekly downloads | 0 |
| License | ISC |
| TypeScript types | bundled |
| Module format | ESM + CommonJS |
| Node | >=14 |
| Dependencies | 0 |
| Unpacked size | 276.9 KB |
| Known vulnerabilities | 0 |
| Install scripts | no |
| Author | Manoj Pudasaini |
| Maintainers | manojpudasaini |
| Keywords | message snippet, hamro-chat |

## Links

- npm: https://www.npmjs.com/package/hamrochat-snippet
- npm.io page: https://npm.io/package/hamrochat-snippet

## Recent versions

- 1.0.5 (latest) — 2023-11-27
- 1.0.4 — 2023-11-23
- 1.0.3 — 2023-11-23
- 1.0.2 — 2023-11-23
- 1.0.1 — 2023-11-23
- 1.0.0 — 2023-11-23

## README

# hamrochat-snippet

library to load messages in hamro chat

## Installation

Use the package manager to install hamrochat-snippet.

```bash
npm install hamrochat-snippet
```

## Usage

```javascript
import "hamrochat-snippet/dist/index.css"; //in the root file
import { loadSnippet } from "hamrochat-snippet";
```

```typescript jsx
  <div>
      <div id="chat-snippet"></div>
      {loadSnippet("chat-snippet", message, true, click, longPress, dataObject)}
    </div>
```
Parameters in order
```typescript
snippetId: string, //id of the container where you want to load message snippet.
message: Message //chat message object.
isMyMessage: boolean,
onClickHandler ?: () => any, //callback to handle event on click.
onLongPressHandler ?: () => any, //callback to handle event on long press
metaData ?: MetaDataObject, //overrides message object and loads card/snippet component
```

## License

[MIT](https://choosealicense.com/licenses/mit/)

---
_Source: https://npm.io/package/hamrochat-snippet · Machine-readable twin of the npm.io package page. Health data is recomputed on every publish._
