From 2a58d208df62f953ab5751cd021faeeeedb9871b Mon Sep 17 00:00:00 2001 From: switer Date: Tue, 2 Dec 2014 15:58:56 +0800 Subject: [PATCH] add retry api, update doc --- README.md | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/README.md b/README.md index 7c67dc3..fa8297d 100644 --- a/README.md +++ b/README.md @@ -50,6 +50,18 @@ Define chain steps, if a then step has multiple functions, step over after each Chain(func).then(func1).then(funcA1, funcA2, funcA3) ``` +### .retry() +Call current step handler once again (recursive). +```javascript +var flag +Chain(function (chain, data) { + if (flag) { + return chain.next() + } + flag = true +}).start('value') +``` + ### .some(func, func1, ..., funcN) When call chain.next in which handler of "some" step will be over current step. ```javascript