<commit_before># ReSwiftThunk
A thunk middleware for [ReSwift](https://github.com/ReSwift/ReSwift).

## Installation

### Cocoapods
```
pod 'ReSwiftThunk', '~> 0.1'
```

### Carthage
```
github "mikecole20/ReSwiftThunk" ~> 0.1
```

## Usage
Include the `ThunkMiddleware` when you create your ReSwift store.
```
let mainStore = Store<AppState>(
    reducer: AppReducer(),
    state: nil,
    middleware: [ThunkMiddleware]
)
```

Extend `ThunkAction` to define your asynchronous actions. Usually, they will dispatch regular `Action`s inside. I like to use functions to create the `ThunkAction`.
```
struct ActionRestPassword: Action {
}

struct ActionResetPasswordSuccess: Action {
}

struct ActionResetPasswordFailure: Action {<commit_msg>ThunkMiddleware is now a function that needs to be called, instead of a symbol. This ties the generic parameter of the Store to that of the ThunkMiddleware.<commit_after># ReSwiftThunk
A thunk middleware for [ReSwift](https://github.com/ReSwift/ReSwift).

## Installation

### Cocoapods
```
pod 'ReSwiftThunk', '~> 0.1'
```

### Carthage
```
github "mikecole20/ReSwiftThunk" ~> 0.1
```

## Usage
Include the `ThunkMiddleware` when you create your ReSwift store.
```
let mainStore = Store<AppState>(
    reducer: AppReducer(),
    state: nil,
    middleware: [ThunkMiddleware()]
)
```

Extend `ThunkAction` to define your asynchronous actions. Usually, they will dispatch regular `Action`s inside. I like to use functions to create the `ThunkAction`.
```
struct ActionRestPassword: Action {
}

struct ActionResetPasswordSuccess: Action {
}

struct ActionResetPasswordFailure: Action {
{'fraction_non_alphanumeric': 0.1202961135101789, 'fraction_numerical': 0.007402837754472548, 'mean_word_length': 5.120754716981132, 'pattern_counts': {'":': 0, '<': 5, '<?xml version=': 0, '>': 9, 'https://': 2, 'lorem ipsum': 0, 'www.': 0, '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': '5572829', 'n_tokens_mistral': 537, 'n_tokens_neox': 501, 'n_words': 160}