Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- class Timeout
- id: null
- cleared: false
- constructor: (fn, interval, scope, args) ->
- scope = scope or window
- wrap = =>
- @clear()
- fn.apply(scope, args or arguments)
- @id = setTimeout(wrap, interval)
- clear: ->
- clearTimeout(@id)
- @cleared = true
- @id = null
- window.Timeout = Timeout
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement