Skip to content

Commit edc8115

Browse files
committed
fix mini foaf
1 parent e48f91f commit edc8115

File tree

3 files changed

+8
-11
lines changed

3 files changed

+8
-11
lines changed

Diff for: src/main/scala/rww/ui/PNGWindow.scala

+1-3
Original file line numberDiff line numberDiff line change
@@ -52,9 +52,7 @@ object PNGWindow {
5252
f.$.backend.unmount >>
5353
f.$.backend.mounting(f.nextProps)
5454
)
55-
.componentWillMount(f => {
56-
f.backend.mounting(f.props)
57-
})
55+
.componentWillMount(f => f.backend.mounting(f.props))
5856
.configure(OnUnmount.install)
5957
.build
6058

Diff for: src/main/scala/rww/ui/foaf/FOAFInfo.scala

+6-6
Original file line numberDiff line numberDiff line change
@@ -44,7 +44,7 @@ object MiniPersonInfo {
4444

4545
class Backend(t: BackendScope[WProps[Person], Option[JumpTyp]])
4646
extends RxStateObserver[\/[RequestState,NPGPath]](t) {
47-
def mounting(p: WProps[Person]): Unit = observeAndSetState(p.about.npg.jump(p.webAgent))
47+
def mounting(p: WProps[Person]) = observeAndSetState(p.about.npg.jump(p.webAgent))
4848
}
4949

5050

@@ -65,11 +65,11 @@ object MiniPersonInfo {
6565
WebIDBar(P.copy(about=(P.about.npg.pg.pointer,S.flatMap(_.swap.toOption))))
6666
)
6767
})
68-
.componentWillMount(f => Callback(f.backend.mounting(f.props)))
69-
.componentWillReceiveProps(f => Callback {
70-
f.$.backend.unmount
71-
f.$.backend.mounting(f.nextProps)
72-
})
68+
.componentWillReceiveProps(f =>
69+
f.$.backend.unmount >>
70+
f.$.backend.mounting(f.nextProps)
71+
)
72+
.componentWillMount(f => f.backend.mounting(f.props))
7373
.configure(OnUnmount.install)
7474
.build
7575

Diff for: src/main/scala/rww/ui/util/RxStateObserver.scala

+1-2
Original file line numberDiff line numberDiff line change
@@ -18,8 +18,7 @@ abstract class RxStateObserver[S](scope: BackendScope[_, Option[S]])
1818
for {
1919
obs <- CallbackOption.liftOption {
2020
rxo.map(rx =>
21-
//elacin@github points out that `runNow` indicates library code
22-
//"what you really have here is a tiny bit of integration code between rx and scalajs-react"
21+
//thanks to elacin@github for help
2322
rx.foreach(v => scope.setState(Some(v)).runNow(), true))
2423
}
2524
_ <- onUnmount { Callback ( obs.kill() ) }

0 commit comments

Comments
 (0)