Skip to content

Commit 71c30b8

Browse files
author
Vlad Balin
committed
docs
1 parent e909f17 commit 71c30b8

23 files changed

+5588
-9
lines changed

docs/Events.html

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -95,14 +95,15 @@ <h2 id="page_High-level+listening+API">High-level listening API</h2>
9595
<p>This is the preferable listening API and must be used in all application code.</p>
9696
<h3 id="page_listener.listenTo%28other%2C+event%2C+callback%29">listener.listenTo(other, event, callback)</h3>
9797
<p>Tell an object to listen to a particular event on an other object. The advantage of using this form, instead of other.on(event, callback, object), is that listenTo allows the object to keep track of the events, and they can be removed all at once later on. The callback will always be called with object as context.</p>
98-
<pre><code>view.listenTo(model, 'change', view.render);
98+
<pre><code>view.listenTo(model, 'change', view.render );
9999
</code></pre>
100100
<h3 id="page_listener.stopListening%28+%5B+other%5D%2C++%5B+event%5D%2C++%5B+callback%5D%29">listener.stopListening([other], [event], [callback])</h3>
101101
<p>Tell an object to stop listening to events. Either call stopListening with no arguments to have the object remove all of its registered callbacks ... or be more precise by telling it to remove just the events it's listening to on a specific object, or a specific event, or just a specific callback.</p>
102-
<pre><code>view.stopListening();
102+
<pre><code>view.stopListening(); // Unsubscribe from all events
103103

104-
view.stopListening(model);
104+
view.stopListening(model); // Unsubscribe from all events from the model
105105
</code></pre>
106+
<p>All Type-R classes execute <code>this.stopListening()</code> from their <code>dispose()</code> method.</p>
106107
<h3 id="page_listener.listenToOnce%28other%2C+event%2C+callback%29">listener.listenToOnce(other, event, callback)</h3>
107108
<p>Just like listenTo, but causes the bound callback to fire only once before being removed.</p>
108109
<h2 id="page_Low-level+listening+API">Low-level listening API</h2>

docs/Mixins - Type-R.htm

Lines changed: 153 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,153 @@
1+
<!DOCTYPE html>
2+
<!-- saved from url=(0055)file:///Users/vlad.balin/GitHub/Type-R/docs/Mixins.html -->
3+
<html class="no-js" lang="en"><!--<![endif]--><head><meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
4+
<title>Mixins - Type-R</title>
5+
<meta name="description" content="Universal state management framework">
6+
<meta name="author" content="Vlad Balin">
7+
8+
<link rel="icon" href="file:///Users/vlad.balin/GitHub/Type-R/docs/themes/daux/img/favicon-navy.png" type="image/x-icon">
9+
<!-- Mobile -->
10+
<meta name="apple-mobile-web-app-capable" content="yes">
11+
<meta name="viewport" content="width=device-width, initial-scale=1.0">
12+
13+
<!-- Font -->
14+
<link href="./Mixins - Type-R_files/css" rel="stylesheet" type="text/css">
15+
<!-- CSS -->
16+
<link href="./Mixins - Type-R_files/theme-navy.min.css" rel="stylesheet" type="text/css">
17+
<!-- Tipue Search -->
18+
<link href="./Mixins - Type-R_files/tipuesearch.css" rel="stylesheet">
19+
20+
<!--[if lt IE 9]>
21+
<script src="http://html5shiv.googlecode.com/svn/trunk/html5.js"></script>
22+
<![endif]-->
23+
</head>
24+
<body class="">
25+
26+
<header class="Navbar hidden-print">
27+
<a class="Navbar__brand" href="file:///Users/vlad.balin/GitHub/Type-R/docs/index.html">Type-R</a>
28+
29+
<div class="Search">
30+
<svg class="Search__icon" xmlns="http://www.w3.org/2000/svg" viewBox="0 0 451 451"><path d="M447.05 428l-109.6-109.6c29.4-33.8 47.2-77.9 47.2-126.1C384.65 86.2 298.35 0 192.35 0 86.25 0 .05 86.3.05 192.3s86.3 192.3 192.3 192.3c48.2 0 92.3-17.8 126.1-47.2L428.05 447c2.6 2.6 6.1 4 9.5 4s6.9-1.3 9.5-4c5.2-5.2 5.2-13.8 0-19zM26.95 192.3c0-91.2 74.2-165.3 165.3-165.3 91.2 0 165.3 74.2 165.3 165.3s-74.1 165.4-165.3 165.4c-91.1 0-165.3-74.2-165.3-165.4z"></path></svg>
31+
<input type="search" id="tipue_search_input" class="Search__field" placeholder="Search..." autocomplete="on" results="25" autosave="text_search">
32+
</div>
33+
</header>
34+
<div class="Columns content">
35+
<aside class="Columns__left Collapsible">
36+
<div class="Collapsible__container">
37+
<button type="button" class="Button Collapsible__trigger">
38+
<span class="Collapsible__trigger--bar"></span>
39+
<span class="Collapsible__trigger--bar"></span>
40+
<span class="Collapsible__trigger--bar"></span>
41+
</button>
42+
</div>
43+
44+
<div class="Collapsible__content">
45+
<!-- Navigation -->
46+
<ul class="Nav"><li class="Nav__item "><a href="file:///Users/vlad.balin/GitHub/Type-R/docs/Getting_Started.html">Getting Started</a></li><li class="Nav__item "><a href="file:///Users/vlad.balin/GitHub/Type-R/docs/Overview.html">Overview</a></li><li class="Nav__item has-children"><a href="file:///Users/vlad.balin/GitHub/Type-R/docs/General_concepts/Overview.html" class="folder"><i class="Nav__arrow">&nbsp;</i>General concepts</a><ul class="Nav"><li class="Nav__item "><a href="file:///Users/vlad.balin/GitHub/Type-R/docs/General_concepts/Overview.html">Overview</a></li><li class="Nav__item "><a href="file:///Users/vlad.balin/GitHub/Type-R/docs/General_concepts/Aggregation_tree.html">Aggregation tree</a></li><li class="Nav__item "><a href="file:///Users/vlad.balin/GitHub/Type-R/docs/General_concepts/Updates_and_change_events.html">Updates and change events</a></li><li class="Nav__item "><a href="file:///Users/vlad.balin/GitHub/Type-R/docs/General_concepts/Serialization.html">Serialization</a></li><li class="Nav__item "><a href="file:///Users/vlad.balin/GitHub/Type-R/docs/General_concepts/Validation.html">Validation</a></li></ul></li><li class="Nav__item has-children"><a href="file:///Users/vlad.balin/GitHub/Type-R/docs/Record/Overview.html" class="folder"><i class="Nav__arrow">&nbsp;</i>Record</a><ul class="Nav"><li class="Nav__item "><a href="file:///Users/vlad.balin/GitHub/Type-R/docs/Record/Overview.html">Overview</a></li><li class="Nav__item "><a href="file:///Users/vlad.balin/GitHub/Type-R/docs/Record/Aggregation_tree.html">Aggregation tree</a></li><li class="Nav__item "><a href="file:///Users/vlad.balin/GitHub/Type-R/docs/Record/Updates_and_change_events.html">Updates and change events</a></li><li class="Nav__item "><a href="file:///Users/vlad.balin/GitHub/Type-R/docs/Record/Validation.html">Validation</a></li><li class="Nav__item "><a href="file:///Users/vlad.balin/GitHub/Type-R/docs/Record/Serialization.html">Serialization</a></li><li class="Nav__item "><a href="file:///Users/vlad.balin/GitHub/Type-R/docs/Record/id_%20and_id-references.html">id and id-references</a></li></ul></li><li class="Nav__item has-children"><a href="file:///Users/vlad.balin/GitHub/Type-R/docs/Collection/Overview.html" class="folder"><i class="Nav__arrow">&nbsp;</i>Collection</a><ul class="Nav"><li class="Nav__item "><a href="file:///Users/vlad.balin/GitHub/Type-R/docs/Collection/Overview.html">Overview</a></li><li class="Nav__item "><a href="file:///Users/vlad.balin/GitHub/Type-R/docs/Collection/Proxied_array_methods.html">Proxied array methods</a></li><li class="Nav__item "><a href="file:///Users/vlad.balin/GitHub/Type-R/docs/Collection/Iteration_methods.html">Iteration methods</a></li><li class="Nav__item "><a href="file:///Users/vlad.balin/GitHub/Type-R/docs/Collection/Sorted_collections.html">Sorted collections</a></li><li class="Nav__item "><a href="file:///Users/vlad.balin/GitHub/Type-R/docs/Collection/Serialization.html">Serialization</a></li><li class="Nav__item "><a href="file:///Users/vlad.balin/GitHub/Type-R/docs/Collection/Updates_and_Events.html">Updates and Events</a></li><li class="Nav__item "><a href="file:///Users/vlad.balin/GitHub/Type-R/docs/Collection/Validation.html">Validation</a></li></ul></li><li class="Nav__item "><a href="file:///Users/vlad.balin/GitHub/Type-R/docs/Events.html">Events</a></li><li class="Nav__item Nav__item--active"><a href="file:///Users/vlad.balin/GitHub/Type-R/docs/Mixins.html">Mixins</a></li></ul>
47+
48+
<div class="Links">
49+
<hr>
50+
<a href="https://github.com/Volicon/React-MVx/issues" target="_blank">Help/Support/Bugs</a>
51+
<br>
52+
<a href="http://volicon.com/" target="_blank">Made by Volicon (a Verizon company)</a>
53+
<br>
54+
55+
<div class="CodeToggler">
56+
<hr>
57+
<a class="CodeToggler__button CodeToggler__button--main" href="file:///Users/vlad.balin/GitHub/Type-R/docs/Mixins.html#">Hide Code Blocks</a><br>
58+
</div>
59+
60+
<hr>
61+
<div class="Twitter">
62+
<iframe allowtransparency="true" frameborder="0" scrolling="no" style="width:162px; height:20px;" src="./Mixins - Type-R_files/follow_button.html"></iframe>
63+
<br>
64+
<br>
65+
</div>
66+
</div>
67+
</div>
68+
</aside>
69+
<div class="Columns__right">
70+
<div class="Columns__right__content">
71+
<div class="doc_content">
72+
<article class="Page">
73+
74+
<div class="Page__header">
75+
<h1>Mixins</h1>
76+
<span style="float: right; font-size: 10px; color: gray;">
77+
<a href="https://github.com/Volicon/React-MVx/blob/develop/docs/08_Mixins.md" target="_blank">Edit on GitHub</a>
78+
</span>
79+
</div>
80+
81+
82+
<div class="s-content">
83+
<p>Both plain JS object and class constructor may be used as mixins. In the case of the class constructor, missing static members will copied over as well.</p>
84+
<h3 id="page_%40mixins%28+mixinA%2C+mixinB%2C+...+%29+class+..."><code>decorator</code> @mixins( mixinA, mixinB, ... ) class ...</h3>
85+
<p>You need to import mixins decorator to use mixins:</p>
86+
<pre><code class="hljs moonscript"><span class="hljs-keyword">import</span> { mixins } <span class="hljs-keyword">from</span> <span class="hljs-string">'type-r'</span>
87+
88+
...
89+
90+
@mixins( plainObject, MyClass, ... )
91+
<span class="hljs-class"><span class="hljs-keyword">class</span> <span class="hljs-title">X</span> {</span>
92+
...
93+
}
94+
</code></pre>
95+
<h3 id="page_%40mixinRules%28%7B+name+%3A++%2C+...+%7D%29+class+...+%60"><code>decorator</code> @mixinRules({ name : <code>rule</code>, ... }) class ...`</h3>
96+
<p>Define configurable properties merge rules for the specific class. Rules can be extented in any subclass.</p>
97+
<h2 id="page_Mixin+rules">Mixin rules</h2>
98+
<h3 id="page_name+%3A+%27merge%27"><code>rule</code> name : 'merge'</h3>
99+
<p>Assume the property to be an object. Property values from mixins will be merged.</p>
100+
<h3 id="page_name+%3A+%7B+name1+%3A++%2C+...+%7D"><code>rule</code> name : { name1 : <code>rule</code>, ... }</h3>
101+
<p>If merge rule is an object, the corresponding member is expected to be an object and the rule defines the merge rules for its members.</p>
102+
<h3 id="page_name+%3A+%27pipe%27"><code>rule</code> name : 'pipe'</h3>
103+
<p>Property is the function ( x : T ) =&gt; T transforming the value. Multiple functions joined in pipe.</p>
104+
<h3 id="page_name+%3A+%27sequence%27"><code>rule</code> name : 'sequence'</h3>
105+
<p>Property is the function. Multiple functions will be called in sequence.</p>
106+
<h3 id="page_name+%3A+%27reverse%27"><code>rule</code> name : 'reverse'</h3>
107+
<p>Same as sequence, but functions called in reverse sequence.</p>
108+
<h3 id="page_name+%3A+%27mergeSequence%27"><code>rule</code> name : 'mergeSequence'</h3>
109+
<p>Merge the object returned by functions, executing them in sequence.</p>
110+
<h3 id="page_name+%3A+%27every%27"><code>rule</code> name : 'every'</h3>
111+
<p>Property is the function ( ...args : any[] ) =&gt; boolean. Resulting method will return true if every single function returns true.</p>
112+
<h3 id="page_name+%3A+%27some%27"><code>rule</code> name : 'some'</h3>
113+
<p>Same as <code>every</code>, but method will return true when at least one function returns true.</p>
114+
</div>
115+
116+
<nav>
117+
<ul class="Pager">
118+
<li class="Pager--prev"><a href="file:///Users/vlad.balin/GitHub/Type-R/docs/Events.html">Previous</a></li> </ul>
119+
</nav>
120+
</article>
121+
122+
</div>
123+
</div>
124+
</div>
125+
</div>
126+
127+
128+
<!-- jQuery -->
129+
<script src="./Mixins - Type-R_files/jquery-1.11.3.min.js"></script>
130+
131+
<!-- hightlight.js -->
132+
<script src="./Mixins - Type-R_files/highlight.pack.js"></script>
133+
<script>hljs.initHighlightingOnLoad();</script>
134+
135+
<!-- JS -->
136+
137+
<script src="./Mixins - Type-R_files/daux.js"></script>
138+
139+
<!-- Tipue Search -->
140+
<script type="text/javascript" src="./Mixins - Type-R_files/tipuesearch.js"></script>
141+
142+
<script>
143+
window.onunload = function(){}; // force $(document).ready to be called on back/forward navigation in firefox
144+
$(function() {
145+
tipuesearch({
146+
'base_url': ''
147+
});
148+
});
149+
</script>
150+
151+
152+
153+
</body></html>

0 commit comments

Comments
 (0)