Skip to content
This repository has been archived by the owner on Dec 10, 2018. It is now read-only.

2.0 Override RSVP

klabarge edited this page Jan 29, 2016 · 9 revisions

Compatibility

  • ✅ 2.0 | ⛔ 1.9 | ...

Background

QZ Tray 2.0 is bundled with RSVP to provide ECMAScript 6 Promise support. If RSVP is not desired, it can be overridden using qz.api.setPromiseType(...). Override examples are provided below.

BlueBird

  1. Include the new promise library:
<script type="text/javascript" src="https://cdn.jsdelivr.net/bluebird/latest/bluebird.js"></script>

or via npm : npm install bluebird

  1. Override RSVP with Bluebird using qz.api.setPromiseType(...).
qz.api.setPromiseType(Promise.fromCallback);

Q

  1. Include the new promise library:
<script type="text/javascript" src="https://rawgit.com/kriskowal/q/v1/q.js"></script>

or via npm : npm install q

  1. Override RSVP with Q using qz.api.setPromiseType(...).
qz.api.setPromiseType(Q.Promise);

Override SHA256

A hashing algorithm is required for signature validation. Use qz.setSha256Type(...) to override the default hashing library.

Node SHA265

qz.setSha256Type(function(data) {
   return crypto.createHash('sha256').update(data).digest("hex");
});