add documentation for cdn and bower
This commit is contained in:
parent
ab494829c6
commit
0ef8c8beb6
19 changed files with 173 additions and 14 deletions
|
|
@ -23,6 +23,7 @@
|
|||
<div class="col(3,3,12)">
|
||||
<h2 id="core-topics">Core Topics</h2>
|
||||
<ul>
|
||||
<li><a href="installation.html">Installation</a></li>
|
||||
<li><a href="getting-started.html">Getting Started</a></li>
|
||||
<li><a href="routing.html">Routing</a></li>
|
||||
<li><a href="web-services.html">Web Services</a></li>
|
||||
|
|
@ -51,7 +52,7 @@
|
|||
<p>However, using its entire toolset idiomatically can bring lots of benefits: learning to use functional programming in real world scenarios and solidifying good coding practices for OOP and MVC are just some of them.</p>
|
||||
<hr>
|
||||
<h2 id="a-simple-application">A Simple Application</h2>
|
||||
<p>Getting started is surprisingly boilerplate-free:</p>
|
||||
<p>Once you have a <a href="installation.html">copy of Mithril</a>, getting started is surprisingly boilerplate-free:</p>
|
||||
<pre><code class="lang-markup"><!doctype html>
|
||||
<script src="mithril.js"></script>
|
||||
<script>
|
||||
|
|
@ -362,11 +363,11 @@ this.description = function(value) {
|
|||
<p>While this decision allows better API discoverability, the trade-off is that we're largely giving up on custom constraints and behavior. For example, if we wanted to change the application to make the list be persisted, a native Array would most certainly not be a suitable class to use.</p>
|
||||
<p>In order to deal with that type of refactoring, one can explicitly decide to support only a subset of the Array API, and implement another class with the same interface as this subset API.</p>
|
||||
<p>Given the code above, the replacement class would only need to implement the <code>.push()</code> and <code>.map()</code> methods. By freezing APIs and swapping implementations, the developer can completely avoid touching other layers in the application while refactoring.</p>
|
||||
<pre><code class="lang-javascript">todo.Todo = Array;</code></pre>
|
||||
<pre><code class="lang-javascript">todo.TodoList = Array;</code></pre>
|
||||
<p>becomes:</p>
|
||||
<pre><code class="lang-javascript">todo.Todo = {
|
||||
push: function() { /*...*/ },
|
||||
map: function() { /*...*/ }
|
||||
<pre><code class="lang-javascript">todo.TodoList = function () {
|
||||
this.push = function() { /*...*/ },
|
||||
this.map = function() { /*...*/ }
|
||||
};</code></pre>
|
||||
<p>Hopefully these examples give you an idea of ways requirements can change over time and how Mithril's philosophy allows developers to use standard OOP techniques to refactor their codebases, rather than needing to modify large portions of the application.</p>
|
||||
<hr>
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue