homepage: ''
changelog-type: markdown
hash: 2bc91101a0fb17b90026e31d8d45ce82c198005d2e62ae5274005d009dc533c0
test-bench-deps: {}
maintainer: Anton Gushcha <ncrashed@protonmail.com>, Vladimir Krutkin <krutkinvs@gmail.com>
synopsis: Routing and retractable back button for reflex-dom
changelog: |
  0.1.0.0
  =======

  * Initial release.
basic-deps:
  base: ! '>=4.7 && <4.12'
  containers: ! '>=0.5 && <0.7'
  mtl: ! '>=2.1 && <2.3'
  reflex: ! '>=0.4 && <0.7'
  reflex-dom: ! '>=0.4 && <0.7'
  jsaddle: ! '>=0.9 && <0.10'
all-versions:
- 0.1.0.0
author: Anton Gushcha, Aminion, Vladimir Krutkin, Levon Oganyan
latest: 0.1.0.0
description-type: markdown
description: |
  Small library that implements "back" button feature for reflex-dom widgets.
  The core idea of the library is to have reusable widget that maintains history
  of switches and is decoupled from actual implementation of switching widgets.

  The library doesn't use platform specific parts like connection to Android
  system back button or browser back button, but provides functions to bind them
  into your retractable frontend.

  Example of usage:

  ``` haskell
  import Control.Monad
  import Reflex.Dom
  import Reflex.Dom.Retractable

  main :: IO ()
  main = mainWidget $ runRetract frontend

  frontend :: (MonadWidget t m, MonadRetract t m) => m ()
  frontend = void $ retractStack $ pageA 42

  pageA :: (MonadWidget t m, MonadRetract t m) => Int -> m ()
  pageA n = do
     e <- button "Go page B"
     void $ nextWidget $ ffor e $ const Retractable {
         retractableNext = pageB $ n + 1
       , retractablePrev = Just $ pure $ pageA n
       }

  pageB :: (MonadWidget t m, MonadRetract t m) => Int -> m ()
  pageB n = do
    e <- button "Go page A"
    void $ nextWidget $ ffor e $ const  Retractable {
         retractableNext = pageA $ n + 1
       , retractablePrev = Just $ pure $ pageB n
       }
  ```
license-name: MIT

Update from Hackage at 2019-10-12T23:45:12Z
Update from Hackage at 2019-10-12T23:45:12Z
