Skip to content

Commit

Permalink
Add withStepWithOptions.
Browse files Browse the repository at this point in the history
  • Loading branch information
dillonkearns committed Feb 15, 2024
1 parent 7078225 commit 924427b
Showing 1 changed file with 18 additions and 1 deletion.
19 changes: 18 additions & 1 deletion src/Pages/Script/Spinner.elm
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
module Pages.Script.Spinner exposing (CompletionIcon(..), Options, Spinner, encodeCompletionIcon, options, runSteps, runTask, runTaskExisting, runTaskWithOptions, showStep, spinner, start, steps, withImmediateStart, withNamedAnimation, withOnCompletion, withStep)
module Pages.Script.Spinner exposing (CompletionIcon(..), Options, Spinner, encodeCompletionIcon, options, runSteps, runTask, runTaskExisting, runTaskWithOptions, showStep, spinner, start, steps, withImmediateStart, withNamedAnimation, withOnCompletion, withStep, withStepWithOptions)

Check failure on line 1 in src/Pages/Script/Spinner.elm

View workflow job for this annotation

GitHub Actions / elm-review

NoUnused.Modules: Module `Pages.Script.Spinner` is never used.

This module is never used. You may want to remove it to keep your project clean, and maybe detect some unused code in your project.

Check failure on line 1 in src/Pages/Script/Spinner.elm

View workflow job for this annotation

GitHub Actions / elm-review

NoUnused.Exports: Module `Pages.Script.Spinner` is never used.

This module is never used. You may want to remove it to keep your project clean, and maybe detect some unused code in your project.

import BackendTask exposing (BackendTask)
import BackendTask.Http
Expand Down Expand Up @@ -308,6 +308,23 @@ withStep text backendTask steps_ =
)


withStepWithOptions : Options FatalError newValue -> (oldValue -> BackendTask FatalError newValue) -> Steps FatalError oldValue -> Steps FatalError newValue
withStepWithOptions options_ backendTask steps_ =
case steps_ of
Steps previousSteps ->
Steps
(BackendTask.map2
(\pipelineValue newSpinner ->
runTaskExisting
newSpinner
(backendTask pipelineValue)
)
previousSteps
(showStep options_)
|> BackendTask.andThen identity
)


runSteps : Steps FatalError value -> BackendTask FatalError value
runSteps (Steps steps_) =
steps_

0 comments on commit 924427b

Please sign in to comment.