@@ -62,8 +62,6 @@ import Data.Traversable (intercalate, traverse, traverse_)
62
62
import Effect (Effect )
63
63
import Effect.Aff (Aff )
64
64
import Effect.Class (liftEffect )
65
- import Effect.Promise (Promise )
66
- import Effect.Promise.Unsafe (undefer )
67
65
import JSS (JSS , jss )
68
66
import Lumi.Components.Color (colors )
69
67
import Lumi.Components.Column (column )
@@ -84,7 +82,6 @@ import Lumi.Components.Select as Select
84
82
import Lumi.Components.Text (body , body_ , subsectionHeader , text )
85
83
import Lumi.Components.Textarea as Textarea
86
84
import Lumi.Components.Upload as Upload
87
- import Lumi.Components.Utility.AffToPromise (promiseToAff )
88
85
import Prim.Row (class Nub , class Union )
89
86
import React.Basic (JSX , createComponent , element , empty , fragment , keyed , makeStateless )
90
87
import React.Basic.Components.Async (async , asyncWithLoader )
@@ -457,7 +454,7 @@ multiSelect encode opts = formBuilder_ \{ readonly } selected onChange ->
457
454
-- | . (Select.SelectOption additionalData -> JSX)
458
455
-- | -> FormBuilder
459
456
-- | { readonly :: Boolean
460
- -- | , foo :: String -> Promise (Either String
457
+ -- | , foo :: String -> Aff (Either String
461
458
-- | (Array (Select.SelectOption additionalData)))
462
459
-- | | props
463
460
-- | }
@@ -468,7 +465,7 @@ asyncSelect
468
465
. IsSymbol l
469
466
=> Cons
470
467
l
471
- (String -> Promise (Array a ))
468
+ (String -> Aff (Array a ))
472
469
rest
473
470
(readonly :: Boolean | props )
474
471
=> SProxy l
@@ -487,7 +484,7 @@ asyncSelect l toSelectOption optionRenderer =
487
484
488
485
else Select .asyncSingleSelect
489
486
{ value
490
- , loadOptions: \search -> promiseToAff (undefer ( get l props search))
487
+ , loadOptions: get l props
491
488
, onChange: onChange
492
489
, className: " "
493
490
, style: css {}
@@ -510,12 +507,12 @@ asyncSelectByKey
510
507
=> IsSymbol l
511
508
=> Cons
512
509
k
513
- (id -> Promise a )
510
+ (id -> Aff a )
514
511
rest1
515
512
(readonly :: Boolean | props )
516
513
=> Cons
517
514
l
518
- (String -> Promise (Array a ))
515
+ (String -> Aff (Array a ))
519
516
rest2
520
517
(readonly :: Boolean | props )
521
518
=> SProxy k
@@ -528,7 +525,7 @@ asyncSelectByKey
528
525
asyncSelectByKey k l fromId toId toSelectOption optionRenderer =
529
526
formBuilder_ \props@{ readonly } value onChange ->
530
527
FetchCache .single
531
- { getData: \key -> promiseToAff (undefer ( get k props (toId key)) )
528
+ { getData: \key -> get k props (toId key)
532
529
, id: map fromId value
533
530
, render: \data_ ->
534
531
if readonly
@@ -546,7 +543,7 @@ asyncSelectByKey k l fromId toId toSelectOption optionRenderer =
546
543
else
547
544
Select .asyncSingleSelect
548
545
{ value: data_
549
- , loadOptions: \search -> promiseToAff (undefer ( get l props search))
546
+ , loadOptions: get l props
550
547
, onChange: onChange <<< map (toId <<< _.value <<< toSelectOption)
551
548
, className: " "
552
549
, style: css {}
0 commit comments