LoginSignup
1
1

More than 3 years have passed since last update.

最近やったことのメモ(MVVM, asyncとdefer)

Last updated at Posted at 2020-12-03

MVVM

Webサービスの設計思想(ソフトウェアアーキテクチャ)
MはModel、VはView、VMはViewModelのこと

View -> View Model -> Model の順

役割でいうと、
表示 → 表示するために値の取得と加工 → 値  こんな感じ?

View Modelが値と表示の間を取り持ってくれます。超優秀ですね☆

asyncとdefer

JavaScriptファイルの非同期での読み込み
<script async src="/abc.js"></script>
<script defer src="/xyz.js"></script>

asyncとdeferどちらもドキュメントのパース中にスクリプトをダウンロード実行。

async・・・パースが完了前に実行。asyncスクリプトの実行は必ずしも順番通りではない。
defer・・・パース完了後に実行。deferスクリプトの実行は順番に行われる。

スクリプトが独立 → async
スクリプトが依存 → defer

今日の名言

Perfection is achieved, not when there is nothing more to add, but when there is nothing left to take away.
(付け足すものがなくなったときでなく、取り除くものがなくなったとき、それが完璧になるということだ)
-アントワーヌ・ド・サン=テグジュペリ(作家)

1
1
0

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
1
1