Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat: allow to pass a data & returnValue formatters #238

Merged
merged 1 commit into from
Feb 24, 2021

Conversation

felixmosh
Copy link
Owner

@Jivings, I've added this ability with a different approach.

// server.js

const Queue = require('bull')
const QueueMQ = require('bullmq')
const { setQueues, BullMQAdapter, BullAdapter } = require('bull-board')

const someQueue = new Queue()
const someOtherQueue = new Queue()
const queueMQ = new QueueMQ()

const someQueueAdapter = new BullAdapter(someQueue);

someQueueAdapter.setFormatter('data', ({ secret, ...rest }) => ({ ...rest })); // this will apply data formatter
someQueueAdapter.setFormatter('returnValue', ({ token, ...rest }) => ({ ...rest })); // this will apply returnValue formatter

setQueues([
  someQueueAdapter,
  new BullAdapter(someOtherQueue),
  new BullMQAdapter(queueMQ),
]);

closes #204

@felixmosh felixmosh merged commit d4ee5b9 into master Feb 24, 2021
@felixmosh felixmosh deleted the allow-format-data branch February 24, 2021 18:50
@Jivings
Copy link
Contributor

Jivings commented Feb 25, 2021

LGTM :)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants