google / uniflow-polymer

UniFlow for Polymer
https://google.github.io/uniflow-polymer/
Apache License 2.0
165 stars 21 forks source link

Question: Does uniflow support using uniflow sub components? #10

Closed mdgbayly closed 6 years ago

mdgbayly commented 7 years ago

Just starting to look at uniflow. Looks interesting. We are currently using Polymer-Redux in our app but interested in comparing it with alternative approaches.

One area we struggle with is building UI components that can manage their own state and actions and then just be dropped into an existing app which may also be using Redux. There are solutions in the Redux world, but I have not really got to grips with them yet, so we're still using the default approach of a single application level state atom that all our components tie into.

I'm sure I could answer this question myself after I've spent some time digging into uniflow a bit more, but just wondering if that is something that you considered with uniflow.

militeev commented 7 years ago

In my opinion rule of thumb is the following: if there's component specific state that is neither persisted nor affects other elements, there's no problem in keeping this state within the element. Otherwise the data should be part of global application state, that should be either passed through the input or observed (if element is state-aware).