« first day (2123 days earlier)      last day (1401 days later) » 

3:59 AM
oh well
 
 
4 hours later…
8:21 AM
ta-da
 
8:38 AM
and I'll try to describe my Q.

Let's say I want to open dialog from one of the child component.
And I need to pass some information to dialogComponent as well.

I can't map childNav to parentNav because passed information won't be available in the model.

So, currently, I created some helper component like this one:
    type private NavToMsgComponent<'Model,'NavChild,'MessageParent>
        (child : IComponent<'Model,'NavChild,'MessageParent>,
         mapper : 'NavChild -> 'MessageParent) =
        interface IComponent<'Model,unit,'MessageParent> with
            member __.Install (_ : Dispatch<unit>)
                              (source : BindingSource)
                              (model : ISignal<'Model>)
                              : IObservable<'MessageParent> list =

                let disp = Dispatcher<'MessageParent>()
and usage
someComponent
|> Component.withMappedMessages Msg.SomeComponentMsg
|> Component.withNavToMsg (function| SomeComponentNavMsgs.SomeRequest v -> Msg.RequestSomeDialog v)
|> Component.suppressNavigation
it works but maybe there is a better way?
 
 
12 hours later…
9:13 PM
@FoggyFinder "because passed information won't be available in the model." <--- why is that?
 
 
1 hour later…
10:21 PM
| NavMsg.SomeRequest v ->
      Navigation.Page.dialog
         Views.SomeDialogView
         (fun _ -> Somecomponent.createInit v) // this
         Update.AppComponents.someComponent
         id
why? I'll try to remember. I don't have a sample now so I can't to run it
maybe because of this line:
(fun m -> msgMapper m |> app.UpdateAsync |> Async.Start)
app doesn't know about updated state
 

« first day (2123 days earlier)      last day (1401 days later) »