forked from SeverinDK/moment-timer
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
update moment.js version and create nodejs example
- updated moment.js version in vendor folder - added r.js (require.js) - created nodejs example Minor version bump, Security fix - corrects security advisories 55 & 532 moment/moment#4163 moment/moment#4326 Update package.json and readme.
- Loading branch information
1 parent
0ad5f84
commit 214b742
Showing
7 changed files
with
36,136 additions
and
496 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,33 @@ | ||
const requirejs = require("../vendor/r.js") | ||
|
||
requirejs.config({ | ||
packages: [{ | ||
name: 'moment', | ||
location: '../vendor', | ||
main: 'moment' | ||
}] | ||
}) | ||
|
||
let moment = requirejs('moment') | ||
let timer = requirejs("../../lib/moment-timer.js") | ||
|
||
let timeoutStartTick = new Date().getTime(); | ||
let timeout = moment.duration(1000).timer({ | ||
loop: false | ||
}, | ||
function() { | ||
console.log(`Timeout Callback fired ${(new Date().getTime() - timeoutStartTick)} ms after script was started.`); | ||
}); | ||
|
||
let limit = 10 | ||
let intervalStartTick = new Date().getTime(); | ||
let interval = moment.duration(1, "seconds").timer({ | ||
loop: true, | ||
wait: 2500, | ||
executeAfterWait: true | ||
}, | ||
function() { | ||
limit --; | ||
if (limit == 0) { interval.stop() } | ||
console.log(`Interval Callback fired ${(new Date().getTime() - intervalStartTick)} ms after script was started.`); | ||
}); |
Large diffs are not rendered by default.
Oops, something went wrong.
Oops, something went wrong.