<commit_before># Flow.m

Simple async processing with pass/miss. 

 Inspired by flow.js. [Github](https://github.com/uupaa/flow.js) | [slideshare](http://www.slideshare.net/uupaa/flowjs)

 ## Usage 

 Setup with cocoapods:

 ```ruby
 pod 'Flow.m'
 ```

and Import:

```objectie-c
#import "FMFlow.h"
```

## Feature

Calls completion blocks if `pass` counts reached `waits`.

```objective-c
// Wait 2 passes.
FMFlow *flow = [FMFlow flowWithWaits:2 completionBlock:^(NSError *error, FMArguments *arguments) {
    NSLog(@"Flow!");
}];

[flow pass];
[flow pass]; // Flow!
```

### extend

Can add `waits` later.

```objective-c
// Wait a pass.
FMFlow *flow = [FMFlow flowWithWaits:1 completionBlock:^(NSError *error, FMArguments *arguments) {
    NSLog(@"Flow!");
}];

[flow extend:1]; // Added 1 waits.

[flow pass];
[flow pass];  // Flow!
```

## arguments

Completion blocks can receive arguments, its created by `passWithValue:` or `passWithValue:forKey:`.
Can get argument by `key` or `index`.

```objective-c<commit_msg>fixed readme<commit_after># Flow.m

Simple async processing with pass/miss. 

 Inspired by flow.js. [Github](https://github.com/uupaa/flow.js) | [slideshare](http://www.slideshare.net/uupaa/flowjs)

## Usage 

 Setup with cocoapods:

 ```ruby
 pod 'Flow.m'
 ```

and Import:

```objectie-c
#import "FMFlow.h"
```

## Feature

Calls completion blocks if `pass` counts reached `waits`.

```objective-c
// Wait 2 passes.
FMFlow *flow = [FMFlow flowWithWaits:2 completionBlock:^(NSError *error, FMArguments *arguments) {
    NSLog(@"Flow!");
}];

[flow pass];
[flow pass]; // Flow!
```

### extend

Can add `waits` later.

```objective-c
// Wait a pass.
FMFlow *flow = [FMFlow flowWithWaits:1 completionBlock:^(NSError *error, FMArguments *arguments) {
    NSLog(@"Flow!");
}];

[flow extend:1]; // Added 1 waits.

[flow pass];
[flow pass];  // Flow!
```

### arguments

Completion blocks can receive arguments, its created by `passWithValue:` or `passWithValue:forKey:`.
Can get argument by `key` or `index`.

```objective-c
{'fraction_non_alphanumeric': 0.17474302496328928, 'fraction_numerical': 0.004894762604013705, 'mean_word_length': 4.254498714652956, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 3, 'https://': 2, 'lorem ipsum': 0, 'www.': 2, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '6756509', 'n_tokens_mistral': 767, 'n_tokens_neox': 719, 'n_words': 198}