1module Tauri.Internal.Resource (acquireDisposer, once) where
6import Effect.Aff (Aff, generalBracket)
7import Effect.Class (liftEffect)
8import Effect.Ref as Ref
9import Promise (Promise)
10import Promise.Aff (toAffE)
12-- A pending native registration cannot be aborted. If the Aff is cancelled,
13-- wait for its real unlisten handle and dispose it rather than leaking it.
14acquireDisposer :: Effect (Promise (Effect Unit)) -> Aff (Effect Unit)
15acquireDisposer acquire = generalBracket
16 (toAffE acquire >>= liftEffect <<< once)
17 { killed: \_ dispose -> liftEffect dispose
18 , failed: \_ dispose -> liftEffect dispose
19 , completed: \_ _ -> pure unit
23once :: Effect Unit -> Effect (Effect Unit)
25 disposed <- Ref.new false
27 alreadyDisposed <- Ref.read disposed
28 unless alreadyDisposed do
29 Ref.write true disposed
keysesc to close
- j k
- move down, up
- enter
- open
- esc
- back, or up a level
- 1 2 3 4
- readme, files, commits, refs
- /
- filter
- y
- copy the clone command
- c
- compare the chosen commit with another (or shift-click both)
- ?
- show or hide this list