plaa / TimeShift-js

Library for mocking JavaScript's Date object
MIT License
65 stars 28 forks source link

adding ability to call setTime with a callback #14

Closed MaxboDev closed 2 years ago

MaxboDev commented 2 years ago

Have added the ability to pass a callback to setTime. If a callback is passed, it will be called each time the date is evaluated. Also added docs of this feature and how to use it to maintain the normal flow of time.

Shout if there's anything you'd like me to change about it.

plaa commented 2 years ago

Sorry for the delay. I made a few adjustments, now released as 1.2.0. Thanks!

MaxboDev commented 2 years ago

Awesome! thanks a lot @plaa :)