|
| 1 | +<!DOCTYPE html> |
| 2 | +<!--[if lt IE 7]> <html class="no-js ie6 oldie" lang="en"> <![endif]--> |
| 3 | +<!--[if IE 7]> <html class="no-js ie7 oldie" lang="en"> <![endif]--> |
| 4 | +<!--[if IE 8]> <html class="no-js ie8 oldie" lang="en"> <![endif]--> |
| 5 | +<!--[if gt IE 8]><!--> <html class="no-js" lang="en"> <!--<![endif]--> |
| 6 | +<head> |
| 7 | + <title>Iteration methods - Type-R</title> |
| 8 | + <meta name="description" content="Universal state management framework" /> |
| 9 | + <meta name="author" content="Vlad Balin"> |
| 10 | + <meta charset="UTF-8"> |
| 11 | + <link rel="icon" href="../themes/daux/img/favicon-navy.png" type="image/x-icon"> |
| 12 | + <!-- Mobile --> |
| 13 | + <meta name="apple-mobile-web-app-capable" content="yes" /> |
| 14 | + <meta name="viewport" content="width=device-width, initial-scale=1.0"> |
| 15 | + |
| 16 | + <!-- Font --> |
| 17 | + <link href='https://fonts.googleapis.com/css?family=Roboto+Slab:400,100,300,700&subset=latin,cyrillic-ext,cyrillic' rel='stylesheet' type='text/css'> |
| 18 | + <!-- CSS --> |
| 19 | + <link href='../themes/daux/css/theme-navy.min.css' rel='stylesheet' type='text/css'> |
| 20 | + <!-- Tipue Search --> |
| 21 | + <link href="../tipuesearch/tipuesearch.css" rel="stylesheet"> |
| 22 | + |
| 23 | + <!--[if lt IE 9]> |
| 24 | + <script src="http://html5shiv.googlecode.com/svn/trunk/html5.js"></script> |
| 25 | + <![endif]--> |
| 26 | +</head> |
| 27 | +<body class=""> |
| 28 | + |
| 29 | +<header class="Navbar hidden-print"> |
| 30 | + <a class="Navbar__brand" href="../index.html">Type-R</a> |
| 31 | + |
| 32 | + <div class="Search"> |
| 33 | + <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"/></svg> |
| 34 | + <input type="search" id="tipue_search_input" class="Search__field" placeholder="Search..." autocomplete="on" results=25 autosave=text_search> |
| 35 | + </div> |
| 36 | +</header> |
| 37 | +<div class="Columns content"> |
| 38 | + <aside class="Columns__left Collapsible"> |
| 39 | + <div class="Collapsible__container"> |
| 40 | + <button type="button" class="Button Collapsible__trigger"> |
| 41 | + <span class="Collapsible__trigger--bar"></span> |
| 42 | + <span class="Collapsible__trigger--bar"></span> |
| 43 | + <span class="Collapsible__trigger--bar"></span> |
| 44 | + </button> |
| 45 | + </div> |
| 46 | + |
| 47 | + <div class="Collapsible__content"> |
| 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="../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/Transactions_and_Events.html">Transactions and 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></ul></li></ul> |
| 50 | + |
| 51 | + <div class="Links"> |
| 52 | + <hr/> |
| 53 | + <a href="https://github.com/Volicon/React-MVx/issues" target="_blank">Help/Support/Bugs</a> |
| 54 | + <br /> |
| 55 | + <a href="http://volicon.com" target="_blank">Made by Volicon (a Verizon company)</a> |
| 56 | + <br /> |
| 57 | + |
| 58 | + <div class="CodeToggler"> |
| 59 | + <hr/> |
| 60 | + <a class="CodeToggler__button CodeToggler__button--main" href="#">Show Code Blocks Inline</a><br> |
| 61 | + </div> |
| 62 | + |
| 63 | + <hr/> |
| 64 | + <div class="Twitter"> |
| 65 | + <iframe allowtransparency="true" frameborder="0" scrolling="no" style="width:162px; height:20px;" src="https://platform.twitter.com/widgets/follow_button.html?screen_name=gaperton&show_count=false"></iframe> |
| 66 | + <br /> |
| 67 | + <br /> |
| 68 | + </div> |
| 69 | + </div> |
| 70 | + </div> |
| 71 | + </aside> |
| 72 | + <div class="Columns__right "> |
| 73 | + <div class="Columns__right__content"> |
| 74 | + <div class="doc_content"> |
| 75 | + <article class="Page"> |
| 76 | + |
| 77 | + <div class="Page__header"> |
| 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 | + <span style="float: right; font-size: 10px; color: gray;"> |
| 82 | + <a href="https://github.com/Volicon/React-MVx/blob/develop/docs/05_Collection/02_Iteration_methods.md" target="_blank">Edit on GitHub</a> |
| 83 | + </span> |
| 84 | + </div> |
| 85 | + |
| 86 | + |
| 87 | + <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> |
| 91 | +<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> |
| 93 | +<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 | +for the group of changes to the records made in <code>updateEach</code>.</p> |
| 95 | +<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> |
| 97 | +<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 | +<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> |
| 100 | +<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> |
| 102 | +<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> |
| 104 | +<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> |
| 106 | +<p>Return <code>true</code> if at least one record match the predicated.</p> |
| 107 | + </div> |
| 108 | + |
| 109 | + <nav> |
| 110 | + <ul class="Pager"> |
| 111 | + <li class=Pager--prev><a href="../Collection/Proxied_array_methods.html">Previous</a></li> <li class=Pager--next><a href="../Collection/Sorted_collections.html">Next</a></li> </ul> |
| 112 | + </nav> |
| 113 | + </article> |
| 114 | + |
| 115 | + </div> |
| 116 | + </div> |
| 117 | + </div> |
| 118 | +</div> |
| 119 | + |
| 120 | + |
| 121 | + <!-- jQuery --> |
| 122 | + <script src="../themes/daux/js/jquery-1.11.3.min.js"></script> |
| 123 | + |
| 124 | + <!-- hightlight.js --> |
| 125 | + <script src="../themes/daux/js/highlight.pack.js"></script> |
| 126 | + <script>hljs.initHighlightingOnLoad();</script> |
| 127 | + |
| 128 | + <!-- JS --> |
| 129 | + |
| 130 | + <script src="../themes/daux/js/daux.js"></script> |
| 131 | + |
| 132 | + <!-- Tipue Search --> |
| 133 | + <script type="text/javascript" src="../tipuesearch/tipuesearch.js"></script> |
| 134 | + |
| 135 | + <script> |
| 136 | + window.onunload = function(){}; // force $(document).ready to be called on back/forward navigation in firefox |
| 137 | + $(function() { |
| 138 | + tipuesearch({ |
| 139 | + 'base_url': '../' |
| 140 | + }); |
| 141 | + }); |
| 142 | + </script> |
| 143 | + |
| 144 | +</body> |
| 145 | +</html> |
0 commit comments