Software zum Installieren eines Smart-Mirror Frameworks , zum Nutzen von hochschulrelevanten Informationen, auf einem Raspberry-Pi.
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

promiseCallback.js 532B

1234567891011121314151617181920212223
  1. 'use strict';
  2. Object.defineProperty(exports, "__esModule", {
  3. value: true
  4. });
  5. const PROMISE_SYMBOL = Symbol('promiseCallback');
  6. function promiseCallback() {
  7. let resolve, reject;
  8. function callback(err, ...args) {
  9. if (err) return reject(err);
  10. resolve(args.length > 1 ? args : args[0]);
  11. }
  12. callback[PROMISE_SYMBOL] = new Promise((res, rej) => {
  13. resolve = res, reject = rej;
  14. });
  15. return callback;
  16. }
  17. exports.promiseCallback = promiseCallback;
  18. exports.PROMISE_SYMBOL = PROMISE_SYMBOL;