Skip to content
Browse files

Merge pull request #4 from iamyellow/master

README correction and until method
  • Loading branch information...
2 parents d8f202b + 61685f4 commit 982ab33b477f30d126c88c72eb4d9d015cf601a0 @elving committed Nov 14, 2012
Showing with 7 additions and 2 deletions.
  1. +1 −1 README.md
  2. +6 −1 wait.js
View
2 README.md
@@ -94,7 +94,7 @@ Time can be specified in various formats:
## Usage
// nodejs
- require('wait');
+ require('waitjs');
<!-- browser -->
<script src="wait.js"></script>
View
7 wait.js
@@ -94,6 +94,11 @@
};
root.until = function(condition, callback, time, id) {
+ if (condition()) {
+ callback();
+ return;
+ }
+
if (arguments.length === 3) {
if (isTime(time) || isNumber(time)) {
time = time;
@@ -114,7 +119,7 @@
root.clear(interval);
callback();
}
- }, id, true);
+ }, id, false);
return interval;
};

0 comments on commit 982ab33

Please sign in to comment.
Something went wrong with that request. Please try again.