]> gerrit.simantics Code Review - simantics/district.git/blob - org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/dezalgo/dezalgo.js
Adding integrated tile server
[simantics/district.git] / org.simantics.maps.server / node / node-v4.8.0-win-x64 / node_modules / npm / node_modules / dezalgo / dezalgo.js
1 var wrappy = require('wrappy')
2 module.exports = wrappy(dezalgo)
3
4 var asap = require('asap')
5
6 function dezalgo (cb) {
7   var sync = true
8   asap(function () {
9     sync = false
10   })
11
12   return function zalgoSafe() {
13     var args = arguments
14     var me = this
15     if (sync)
16       asap(function() {
17         cb.apply(me, args)
18       })
19     else
20       cb.apply(me, args)
21   }
22 }