1.0.6 • Published 3 years ago

@motech-development/messages v1.0.6

Weekly downloads
-
License
MIT
Repository
github
Last release
3 years ago

npm size sonar

@motech-development/messages

Normalise broker messages

Constructs a consistent broker message.

Installation

Add @motech-development/messages as a dependency.

# Yarn
yarn add @motech-development/messages

# NPM
npm i @motech-development/messages

Usage

Use the message utility to create a new message.

import { message } from '@motech-development/messages';

const dataMsg = message({
  data: {
    anything: 'can',
    go: 'in here',
  },
});

const idMsg = message({
  id: 'your-id-goes-here',
});

const dataWithIdMsg = message({
  data: {
    anything: 'can',
    go: 'in here',
  },
  id: 'your-id-goes-here',
});

client.send('create', dataMsg);

client.send('remove', idMsg);

client.send('update', msg);
1.0.6

3 years ago

1.0.5

3 years ago

1.0.4

3 years ago

1.0.3

3 years ago

1.0.2

3 years ago

1.0.1

3 years ago

1.0.0

3 years ago