Skip to content
This repository has been archived by the owner on Jan 5, 2022. It is now read-only.

Component Design Considerations

Eric Jackson edited this page May 9, 2015 · 3 revisions

Although not yet implemented, one of our goals for GBE components is that viewers should be able to share a link that encodes whatever state is needed to reproduce exactly the view that they see. This capability will be important both to better support public conversation (allowing citizens to say on Facebook, for example, "Hey, check out this wonderful/horrible thing the city's doing in the budget!") and to enable local media to iframe in a specific view relevant to an article.

Not yet sure exactly how we'll do this, but it's important at least to make sure that you make component state changes via the dispatcher, as illustrated in the MultiYear Table component (see the onSelectChange function).

More as we figure it out ...

Gotchas

Storing state locally

Do not store any state locally that must survive between the user leaving the page the component is on and another page. Components are recreated by the layout manager and so do not share internal state between instantiations. However, the components storeId will remain the same, so that properties and state variables accessed using it are shared between instantiations.