|
46 | 46 |
|
47 | 47 | <div class="Collapsible__content"> |
48 | 48 | <!-- Navigation --> |
49 | | - <ul class='Nav'><li class='Nav__item '><a href="../Getting_Started.html">Getting Started</a></li><li class='Nav__item '><a href="../Overview.html">Overview</a></li><li class='Nav__item has-children'><a href="../General_concepts/Overview.html" class="folder"><i class="Nav__arrow"> </i>General concepts</a><ul class='Nav'><li class='Nav__item '><a href="../General_concepts/Overview.html">Overview</a></li><li class='Nav__item '><a href="../General_concepts/Aggregation_tree.html">Aggregation tree</a></li><li class='Nav__item '><a href="../General_concepts/Updates_and_change_events.html">Updates and change events</a></li><li class='Nav__item '><a href="../General_concepts/Serialization.html">Serialization</a></li><li class='Nav__item '><a href="../General_concepts/Validation.html">Validation</a></li></ul></li><li class='Nav__item has-children'><a href="../Record/Overview.html" class="folder"><i class="Nav__arrow"> </i>Record</a><ul class='Nav'><li class='Nav__item '><a href="../Record/Overview.html">Overview</a></li><li class='Nav__item '><a href="../Record/Aggregation_tree.html">Aggregation tree</a></li><li class='Nav__item '><a href="../Record/Events_and_Transactions.html">Events and Transactions</a></li><li class='Nav__item '><a href="../Record/Validation.html">Validation</a></li><li class='Nav__item '><a href="../Record/Serialization.html">Serialization</a></li><li class='Nav__item '><a href="../Record/id_ and_id-references.html">id and id-references</a></li></ul></li><li class='Nav__item Nav__item--open has-children'><a href="../Collection/Overview.html" class="folder"><i class="Nav__arrow"> </i>Collection</a><ul class='Nav'><li class='Nav__item '><a href="../Collection/Overview.html">Overview</a></li><li class='Nav__item '><a href="../Collection/Proxied_array_methods.html">Proxied array methods</a></li><li class='Nav__item Nav__item--active'><a href="../Collection/Iteration_methods.html">Iteration methods</a></li><li class='Nav__item '><a href="../Collection/Sorted_collections.html">Sorted collections</a></li><li class='Nav__item '><a href="../Collection/Serialization.html">Serialization</a></li><li class='Nav__item '><a href="../Collection/Updates_and_Events.html">Updates and Events</a></li><li class='Nav__item '><a href="../Collection/Validation.html">Validation</a></li></ul></li><li class='Nav__item '><a href="../Events.html">Events</a></li><li class='Nav__item '><a href="../Mixins.html">Mixins</a></li></ul> |
| 49 | + <ul class='Nav'><li class='Nav__item '><a href="../Getting_Started.html">Getting Started</a></li><li class='Nav__item '><a href="../Overview.html">Overview</a></li><li class='Nav__item has-children'><a href="../General_concepts/Overview.html" class="folder"><i class="Nav__arrow"> </i>General concepts</a><ul class='Nav'><li class='Nav__item '><a href="../General_concepts/Overview.html">Overview</a></li><li class='Nav__item '><a href="../General_concepts/Aggregation_tree.html">Aggregation tree</a></li><li class='Nav__item '><a href="../General_concepts/Updates_and_change_events.html">Updates and change events</a></li><li class='Nav__item '><a href="../General_concepts/Serialization.html">Serialization</a></li><li class='Nav__item '><a href="../General_concepts/Validation.html">Validation</a></li></ul></li><li class='Nav__item has-children'><a href="../Record/Overview.html" class="folder"><i class="Nav__arrow"> </i>Record</a><ul class='Nav'><li class='Nav__item '><a href="../Record/Overview.html">Overview</a></li><li class='Nav__item '><a href="../Record/Aggregation_tree.html">Aggregation tree</a></li><li class='Nav__item '><a href="../Record/Updates_and_change_events.html">Updates and change events</a></li><li class='Nav__item '><a href="../Record/Validation.html">Validation</a></li><li class='Nav__item '><a href="../Record/Serialization.html">Serialization</a></li><li class='Nav__item '><a href="../Record/id_ and_id-references.html">id and id-references</a></li></ul></li><li class='Nav__item Nav__item--open has-children'><a href="../Collection/Overview.html" class="folder"><i class="Nav__arrow"> </i>Collection</a><ul class='Nav'><li class='Nav__item '><a href="../Collection/Overview.html">Overview</a></li><li class='Nav__item '><a href="../Collection/Proxied_array_methods.html">Proxied array methods</a></li><li class='Nav__item Nav__item--active'><a href="../Collection/Iteration_methods.html">Iteration methods</a></li><li class='Nav__item '><a href="../Collection/Sorted_collections.html">Sorted collections</a></li><li class='Nav__item '><a href="../Collection/Serialization.html">Serialization</a></li><li class='Nav__item '><a href="../Collection/Updates_and_Events.html">Updates and Events</a></li><li class='Nav__item '><a href="../Collection/Validation.html">Validation</a></li></ul></li><li class='Nav__item '><a href="../Events.html">Events</a></li><li class='Nav__item '><a href="../Mixins.html">Mixins</a></li></ul> |
50 | 50 |
|
51 | 51 | <div class="Links"> |
52 | 52 | <hr/> |
|
76 | 76 |
|
77 | 77 | <div class="Page__header"> |
78 | 78 | <h1>Iteration methods</h1> |
79 | | - <span style="float: left; font-size: 10px; color: gray;"> |
80 | | - Thursday, May 18, 2017 9:48 AM </span> |
81 | 79 | <span style="float: right; font-size: 10px; color: gray;"> |
82 | 80 | <a href="https://github.com/Volicon/React-MVx/blob/develop/docs/05_Collection/02_Iteration_methods.md" target="_blank">Edit on GitHub</a> |
83 | 81 | </span> |
84 | 82 | </div> |
85 | 83 |
|
86 | 84 |
|
87 | 85 | <div class="s-content"> |
88 | | - <h2 id="page_map+and+forEach">map and forEach</h2> |
89 | | -<h4 id="page_collection.forEach%28+iteratee+%3A+%28+val+%3A+Record%2C+index+%29+%3D%3E+void%2C+context%3F+%29">collection.forEach( iteratee : ( val : Record, index ) => void, context? )</h4> |
90 | | -<h4 id="page_collection.each%28+iteratee+%3A+%28+val+%3A+Record%2C+index+%29+%3D%3E+void%2C+context%3F+%29">collection.each( iteratee : ( val : Record, index ) => void, context? )</h4> |
| 86 | + <h1 id="page_map+and+forEach">map and forEach</h1> |
| 87 | +<h3 id="page_collection.forEach%28+iteratee+%3A+%28+val+%3A+Record%2C+index+%29+%3D%3E+void%2C+context%3F+%29">collection.forEach( iteratee : ( val : Record, index ) => void, context? )</h3> |
| 88 | +<h3 id="page_collection.each%28+iteratee+%3A+%28+val+%3A+Record%2C+index+%29+%3D%3E+void%2C+context%3F+%29">collection.each( iteratee : ( val : Record, index ) => void, context? )</h3> |
91 | 89 | <p>Iterate through the elements of the collection. Similar to <code>Array.forEach</code>.</p> |
92 | | -<h4 id="page_collection.updateEach%28+iteratee+%3A+%28+val+%3A+Record%2C+index+%29+%3D%3E+void%2C+context%3F+%29">collection.updateEach( iteratee : ( val : Record, index ) => void, context? )</h4> |
| 90 | +<h3 id="page_collection.updateEach%28+iteratee+%3A+%28+val+%3A+Record%2C+index+%29+%3D%3E+void%2C+context%3F+%29">collection.updateEach( iteratee : ( val : Record, index ) => void, context? )</h3> |
93 | 91 | <p>Similar to the <code>collection.each</code>, but wraps an iteration in a transaction. The single <code>changes</code> event will be emitted |
94 | 92 | for the group of changes to the records made in <code>updateEach</code>.</p> |
95 | 93 | <p><em>Use this method if you modify records in a loop</em>.</p> |
96 | | -<h4 id="page_collection.map%28+iteratee+%3A+%28+val+%3A+Record%2C+index+%29+%3D%3E+T%2C+context%3F+%29">collection.map( iteratee : ( val : Record, index ) => T, context? )</h4> |
| 94 | +<h3 id="page_collection.map%28+iteratee+%3A+%28+val+%3A+Record%2C+index+%29+%3D%3E+T%2C+context%3F+%29">collection.map( iteratee : ( val : Record, index ) => T, context? )</h3> |
97 | 95 | <p>Map elements of the collection. Similar to <code>Array.map</code>, but <code>undefined</code> values returned by iteratee are filtered out.</p> |
98 | 96 | <p>Thus, <code>collection.map</code> can be used to map and filter elements in a single pass.</p> |
99 | | -<h2 id="page_Predicate+methods">Predicate methods</h2> |
| 97 | +<h1 id="page_Predicate+methods">Predicate methods</h1> |
100 | 98 | <p>Predicate is either the iteratee function returning boolean, or an object with attribute values used to match with record's attributes.</p> |
101 | | -<h4 id="page_collection.filter%28+iteratee+%3A+Predicate%2C+context%3F+%29">collection.filter( iteratee : Predicate, context? )</h4> |
| 99 | +<h3 id="page_collection.filter%28+iteratee+%3A+Predicate%2C+context%3F+%29">collection.filter( iteratee : Predicate, context? )</h3> |
102 | 100 | <p>Return filtered array of records matching the predicate.</p> |
103 | | -<h4 id="page_collection.every%28+iteratee+%3A+Predicate%2C+context%3F+%29+%3A+boolean">collection.every( iteratee : Predicate, context? ) : boolean</h4> |
| 101 | +<h3 id="page_collection.every%28+iteratee+%3A+Predicate%2C+context%3F+%29+%3A+boolean">collection.every( iteratee : Predicate, context? ) : boolean</h3> |
104 | 102 | <p>Return <code>true</code> if all records match the predicate.</p> |
105 | | -<h4 id="page_collection.some%28+iteratee+%3A+Predicate%2C+context%3F+%29+%3A+boolean">collection.some( iteratee : Predicate, context? ) : boolean</h4> |
| 103 | +<h3 id="page_collection.some%28+iteratee+%3A+Predicate%2C+context%3F+%29+%3A+boolean">collection.some( iteratee : Predicate, context? ) : boolean</h3> |
106 | 104 | <p>Return <code>true</code> if at least one record match the predicated.</p> |
107 | 105 | </div> |
108 | 106 |
|
|
0 commit comments