Skip to content

Cancellation of aff action #45

Open
@kamoii

Description

@kamoii

The following Widget consists of an aff action that takes some time and a button to cancel it.
I thought it would kill aff action if I pressed the cancel button while aff action was running, but it didn't stop even after cancel, and "done" was shown in the log.
Is this an intented behaviour?

testWidget :: forall a. Widget HTML a
testWidget = do
  result <- orr
       [ "canceled" <$ button [ onClick ] [ text "cancel" ]
       , liftAff affAction
       ]
  text result
  where
    -- long taking action
    affAction = do
      delay (Milliseconds 5000.0)
      log  "done"
      pure "done"

Metadata

Metadata

Assignees

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions