News for hackers. Stuff that matters.
Re:A Farewell to FRP by d0m on Tuesday May 10, 2016 @12:02PM (#11668181)
One thing I'm wondering with elm is how does it deal with state across different components? I.e. where would you put the settings of the current user and how would you access that within one component? (By component I mean the (init,update,view,subscription))
Re:A Farewell to FRP by ccapndave on Tuesday May 10, 2016 @12:43PM (#11668536)
Another approach is to use extensible records, which give you structural typing similarly to Typescript. This means that you can pass the exact same state record/object around to different components, but a particular component might only specify that the state needs to have a `user` property, whereas another might only specify that the state needs to have a `friends` property.
Re:A Farewell to FRP by redka on Tuesday May 10, 2016 @12:35PM (#11668461)
Since with The Elm Architecture parent always takes care of it's children you can create a "Context" and pass it along.