Polymer Best Practices

I have questions about best practice when developing a Polymer web application.

Say I have a Todo app. The main element my-main-taskis responsible for switching between these elements: listall tasks, viewone task, create a task new, edittask and deletetask.

My question is: newshould the element save data using firebase-documenteither on iron-ajaxits own or delegate it to my-main-task?

+4
source share
1 answer

At the recent Polymer Summit (London, 2016), there was a lot of talk about being lazy (as in lazy loading). This means that you are only loading / rendering what you need and (at best) nothing more.

This suggests that the short answer to your question is: The element newshould save the data on its own, as this is the most suitable place for this.

As for the long answer, carry me for a while.

On the Google Developer Web Fundamentals page , there is actually an architectural template called Application Shell Model . This template actually describes your element my-main-task.

Some useful quotes:

"shell" - HTML, CSS JavaScript, /.../

/.../ , , .

( my-main-task).

, (Github repo, -).

"app shell" shop-app ( ), , :

  • ( , )

, , -.

, Checkout, shop-checkout ( ). , (.. ) , .

shop-list ( ). , , , .

, Shop, . (Youtube video) , : , , . ( ) , ( ) . , .

+4

Source: https://habr.com/ru/post/1659255/


All Articles