Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

use process.nextTick when available

  • Loading branch information...
commit 09eda2bf1e7764a4b6d2874c63d5c9de2ea000b5 1 parent d2bca3f
@mental authored
Showing with 9 additions and 2 deletions.
  1. +9 −2 src/Actor.coffee
View
11 src/Actor.coffee
@@ -3,8 +3,15 @@ WebActors = if require? and exports?
else
@WebActors ?= {}
-nextTick = (cb) ->
- setTimeout(cb, 0)
+if require?
+ try
+ nextTick = require('process').nextTick
+ catch e
+ null
+
+unless nextTick?
+ nextTick = (cb) ->
+ setTimeout(cb, 0)
class NullActor
constructor: ->
Please sign in to comment.
Something went wrong with that request. Please try again.