StevenLambion / SwiftDux

Predictable state management for SwiftUI applications.
http://stevenlambion.github.io/SwiftDux
MIT License
153 stars 9 forks source link

Chaining Action Plans #20

Closed StevenLambion closed 4 years ago

StevenLambion commented 4 years ago

This PR allows action plans to be synchronously chained together.

Work performed

Example:

let chainedActionPlan = actionPlanA
  .then(actionPlanB)
  .then(actionPlanC)
  .then { state in ...do something here... }
  .then(actionPlanD)

dispatch(chainedActionPlan)
codecov-io commented 4 years ago

Codecov Report

Merging #20 into master will increase coverage by 0.93%. The diff coverage is 76%.

Impacted file tree graph

@@           Coverage Diff           @@
##           master   #20      +/-   ##
=======================================
+ Coverage   59.06%   60%   +0.93%     
=======================================
  Files          15    15              
  Lines         386   410      +24     
=======================================
+ Hits          228   246      +18     
- Misses        158   164       +6
Impacted Files Coverage Δ
Sources/SwiftDux/Action/ActionPlan.swift 86.36% <76%> (-13.64%) :arrow_down:

Continue to review full report at Codecov.

Legend - Click here to learn more Δ = absolute <relative> (impact), ø = not affected, ? = missing data Powered by Codecov. Last update b55caaa...9447bb0. Read the comment docs.