Aucune description

dvaServerSync.js 499B

1234567891011121314151617181920212223
  1. "use strict";
  2. Object.defineProperty(exports, "__esModule", {
  3. value: true
  4. });
  5. exports.default = sync;
  6. function sync(key, filter, block) {
  7. return {
  8. onEffect: function (effect, { put }, model, actionType) {
  9. const temp = [];
  10. return function* (...args) {
  11. if (filter(args[0])) {
  12. block.lock(key);
  13. }
  14. yield effect(...args);
  15. if (filter(args[0])) {
  16. block.release(key);
  17. }
  18. };
  19. }
  20. };
  21. }
  22. module.exports = exports["default"];