Skip to content

Commit

Permalink
Examples
Browse files Browse the repository at this point in the history
  • Loading branch information
dex4er committed Oct 24, 2017
1 parent 66e1383 commit be3c740
Show file tree
Hide file tree
Showing 4 changed files with 26 additions and 9 deletions.
15 changes: 15 additions & 0 deletions examples/test-timers-ts.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
#!/usr/bin/env ts-node

import * as timers from '../lib/timers-obj'

const ticker = timers.interval(1000, () => {
console.info('Tick')
})

timers.timeout(5000, () => {
ticker.remove()
})

timers.immediate(() => {
console.info('Time is ticking...')
})
6 changes: 3 additions & 3 deletions examples/test-timers.coffee
Original file line number Diff line number Diff line change
@@ -1,12 +1,12 @@
#!/usr/bin/env coffee

timers = require 'timers-obj'
timers = require '../lib/timers-obj'

ticker = timers.interval 1000, ->
console.log 'Tick'
console.info 'Tick'

timers.timeout 5000, ->
ticker.remove()

timers.immediate ->
console.log 'Time is ticking...'
console.info 'Time is ticking...'
8 changes: 5 additions & 3 deletions examples/test-timers.js
Original file line number Diff line number Diff line change
@@ -1,15 +1,17 @@
#!/usr/bin/env node

'use strict'

const timers = require('timers-obj')
const timers = require('../lib/timers-obj')

let ticker = timers.interval(1000, () => {
console.log('Tick')
console.info('Tick')
})

timers.timeout(5000, () => {
ticker.remove()
})

timers.immediate(() => {
console.log('Time is ticking...')
console.info('Time is ticking...')
})
6 changes: 3 additions & 3 deletions examples/test-timers.ls
Original file line number Diff line number Diff line change
@@ -1,12 +1,12 @@
#!/usr/bin/env lsc

require! 'timers-obj': timers
require! '../lib/timers-obj': timers

ticker = timers.interval 1000 ->
console.log 'Tick'
console.info 'Tick'

timers.timeout 5000 ->
ticker.remove!

timers.immediate ->
console.log 'Time is ticking...'
console.info 'Time is ticking...'

0 comments on commit be3c740

Please sign in to comment.