Back to All Events

Michael Hladky & Jan-Niklas Wortmann

  • Holiday Inn Gent Expo 3 Maaltekouter Saint Denijs-westrem, Vlaanderen, 9051 Belgium (map)

Talk title

Tackling Component-state Reactively

Talk description

Ever heard about a subscription-less component? Think about all the observables you have to subscribe to, and even if you use the async pipe, there are situations where you can’t. It’s a lot of things you have to manage. Is there a smart way to do all this?

@ngrx/store did a great job in managing global state in SPAs. However, nobody talked about the complexity and pain of managing the local component state.

Let me list a few problems you will run into when implementing local state management:

  • Encapsulation and instantiation of local state

  • Managing the structure of the state

  • The late subscriber problem

  • Composition and aggregation of hot and cold observables

  • Sharing references over observables

  • Managing Subscriptions and Side-Effects ChangeDetection and zone.js

  • Manage Highly fluctuating state-structures

After this talk, you are able to solve all of these problems with a clean and structured approach. In a final step, we will pull together the above problems and implement the solutions, driven by a central unit and takes over all the mentioned problems.

Talk takeaways

  • Move low level subscription handling and state composition into a local service.

  • ChangeDetection is triggered ONLY by a pipe or an directive

  • Multicast and Unicast is not the same as and Hot and Cold

  • Consider the late subscriber problem

  • Consider Component live-time and dynamic state

  • Reactive state management also allows you have the full observable context of next, error, complete

  • If you code reactively you actually are already ready to go zone-less

michael.jpeg

About Michael

International Speaker, Trainer and Consultant focused on Angular. Founder of Angular Austria Association, RxJS lover, good citizen of earth.

janniklas.jpeg

About Jan-Niklas

Jan-Niklas Wortmann is a software developer mostly working on Angular related projects. He helps companies in designing and implementing large scaled applications. Developing clean and maintainable code is one of his main goals. Additionally, Jan-Niklas is a member of the RxJS Core Team targeting the developer experience by improving the docs. Besides he's an active member in the Angular community and organizes the NgNiederrhein Meetup.

Screenshot 2019-10-26 14.42.49.png
Earlier Event: December 7
Samantha Brennan
Later Event: December 6
Kwinten Pisman