• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Jeanne Boyarsky
  • Ron McLeod
  • Paul Clapham
  • Liutauras Vilda
Sheriffs:
  • paul wheaton
  • Rob Spoor
  • Devaka Cooray
Saloon Keepers:
  • Stephan van Hulst
  • Tim Holloway
  • Carey Brown
  • Frits Walraven
  • Tim Moores
Bartenders:
  • Mikalai Zaikin

FRP and two-way binding

 
Greenhorn
Posts: 27
Google Web Toolkit Tomcat Server Java
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
FYI: I've been looking at various JavaScript libraries and frameworks, most particularly Polymer. My day spent with FRP raised some questions. I posed this one to the Polymer team:

#AskPolymer +Rob Dodson I read that AngularJS 2 deprecates two-way data binding. Polymer so far takes a different approach, and there are many examples of two-way data binding. How about some examples of how one might achieve similar effects with one-way data binding and functional reactive programming (RxJS or another approach).

 
Author
Posts: 12
5
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hi Thad,

Two-way binding would normally be modelled in FRP as a pair of a Stream<A> to allow changes to the widget - and a Cell<A> giving the current value of the widget. This would be true of a text field or similar widget. Essentially it's a function of this type (in Pseudo-Typescript):



The caller then represents the logic of the model as FRP, creating value loops as necessary. How difficult it is to get your head around actually using this depends to a large extent on how much functional programming you've done.


Steve
 
reply
    Bookmark Topic Watch Topic
  • New Topic