Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- Anti-pattern: Control Flow via View Rendering
- The issue:
- * Certain views require data.
- * Said data is returned asynchronously.
- * In order to render them, a LayoutView is inserted to make the asynchronous request.
- Needlessly creates views/cruft. Options from parent view need to be passed through the wrapper view.
- Ideally would have a synchronous init/render method
- Preface: Most of my views request their own data. The advantage of this is that deeply nested views do not have to be passed down data from their parent.
- When interfacing with views that require data upfront (e.g. TabbedViews, Backbone Forms), a wrapper view needs to be introduced in order to request asynchronous data.
- Two types of views:
- Presenter views (require data) & LayoutViews (request data)
- ChartView(patient) vs MyChart/MyPatientsChart
- LayoutView that renders many children.... eg. PatientDetails, PatientSettings
- change onShow to onBeforeShow
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement