UNPKG

nanoscope

Version:

A Lens Library for Javascript

523 lines (235 loc) 8 kB
<!DOCTYPE html> <html lang="en"> <head> <meta charset="utf-8"> <title>nanoscope Class: Getter</title> <!--[if lt IE 9]> <script src="//html5shiv.googlecode.com/svn/trunk/html5.js"></script> <![endif]--> <link type="text/css" rel="stylesheet" href="styles/sunlight.default.css"> <link type="text/css" rel="stylesheet" href="styles/site.spacelab.css"> </head> <body> <div class="container-fluid"> <div class="navbar navbar-fixed-top "> <div class="navbar-inner"> <a class="brand" href="index.html">nanoscope</a> <ul class="nav"> <li class="dropdown"> <a href="classes.list.html" class="dropdown-toggle" data-toggle="dropdown">Classes<b class="caret"></b></a> <ul class="dropdown-menu "> <li> <a href="Compose.html">Compose</a> </li> <li> <a href="Getter.html">Getter</a> </li> <li> <a href="IndexedLens.html">IndexedLens</a> </li> <li> <a href="IndexedLens.Unsafe.html">IndexedLens.Unsafe</a> </li> <li> <a href="Lens.html">Lens</a> </li> <li> <a href="MultiLens.html">MultiLens</a> </li> <li> <a href="Optional.html">Optional</a> </li> <li> <a href="PathLens.html">PathLens</a> </li> <li> <a href="PathLens.Unsafe.html">PathLens.Unsafe</a> </li> <li> <a href="Setter.html">Setter</a> </li> <li> <a href="SliceLens.html">SliceLens</a> </li> </ul> </li> <li class="dropdown"> <a href="global.html" class="dropdown-toggle" data-toggle="dropdown">Global<b class="caret"></b></a> <ul class="dropdown-menu "> <li> <a href="global.html#get">get</a> </li> <li> <a href="global.html#IdLens">IdLens</a> </li> <li> <a href="global.html#map">map</a> </li> </ul> </li> </ul> </div> </div> <div class="row-fluid"> <div class="span8"> <div id="main"> <h1 class="page-title">Class: Getter</h1> <section> <header> <h2> Getter </h2> </header> <article> <div class="container-overview"> <dt> <h4 class="name" id="Getter"><span class="type-signature"></span>new Getter<span class="signature">(get, options)</span><span class="type-signature"> &rarr; {<a href="Getter.html">Getter</a>}</span></h4> </dt> <dd> <div class="description"> <p>A <code>Getter</code> is a <code>Lens</code> that doesn't support setting or mapping over values. A <code>Getter</code> is constructed using only a <code>get</code> function, which returns the element (or elements) the <code>Lens</code> should view on.</p> </div> <h5>Parameters:</h5> <table class="params table table-striped"> <thead> <tr> <th>Name</th> <th>Type</th> <th class="last">Description</th> </tr> </thead> <tbody> <tr> <td class="name"><code>get</code></td> <td class="type"> <span class="param-type">function</span> </td> <td class="description last"><p>Function to allow access to an object via this lens.</p></td> </tr> <tr> <td class="name"><code>options</code></td> <td class="type"> <span class="param-type">object</span> </td> <td class="description last"><p>Additional flags to set in the resulting Lens</p></td> </tr> </tbody> </table> <dl class="details"> </dl> <h5>Returns:</h5> <dl> <dt> Type </dt> <dd> <span class="param-type"><a href="Getter.html">Getter</a></span> </dd> </dl> </dd> </div> <h3 class="subsection-title">Methods</h3> <dl> <dt> <h4 class="name" id="fromLens"><span class="type-signature">&lt;static> </span>fromLens<span class="signature">(lens)</span><span class="type-signature"></span></h4> </dt> <dd> <div class="description"> <p>Construct a <code>Getter</code> from a <code>Lens</code> by overwriting its map and set functions.</p> </div> <h5>Parameters:</h5> <table class="params table table-striped"> <thead> <tr> <th>Name</th> <th>Type</th> <th class="last">Description</th> </tr> </thead> <tbody> <tr> <td class="name"><code>lens</code></td> <td class="type"> <span class="param-type"><a href="Lens.html">Lens</a></span> </td> <td class="description last"><p>The <code>Lens</code> to convert to a <code>Getter</code>.</p></td> </tr> </tbody> </table> <dl class="details"> </dl> </dd> </dl> </article> </section> </div> <div class="clearfix"></div> <footer> <span class="jsdoc-message"> Documentation generated by <a href="https://github.com/jsdoc3/jsdoc">JSDoc 3.3.0-alpha11</a> on 2014-12-17T09:37:57-05:00 using the <a href="https://github.com/terryweiss/docstrap">DocStrap template</a>. </span> </footer> </div> <div class="span3"> <div id="toc"></div> </div> <br clear="both"> </div> </div> <!--<script src="scripts/sunlight.js"></script>--> <script src="scripts/docstrap.lib.js"></script> <script src="scripts/bootstrap-dropdown.js"></script> <script src="scripts/toc.js"></script> <script> $( function () { $( "[id*='$']" ).each( function () { var $this = $( this ); $this.attr( "id", $this.attr( "id" ).replace( "$", "__" ) ); } ); $( "#toc" ).toc( { anchorName : function ( i, heading, prefix ) { return $( heading ).attr( "id" ) || ( prefix + i ); }, selectors : "h1,h2,h3,h4", showAndHide : false, scrollTo : "100px" } ); $( "#toc>ul" ).addClass( "nav nav-pills nav-stacked" ); $( "#main span[id^='toc']" ).addClass( "toc-shim" ); $( '.dropdown-toggle' ).dropdown(); // $( ".tutorial-section pre, .readme-section pre" ).addClass( "sunlight-highlight-javascript" ).addClass( "linenums" ); $( ".tutorial-section pre, .readme-section pre" ).each( function () { var $this = $( this ); var example = $this.find( "code" ); exampleText = example.html(); var lang = /{@lang (.*?)}/.exec( exampleText ); if ( lang && lang[1] ) { exampleText = exampleText.replace( lang[0], "" ); example.html( exampleText ); lang = lang[1]; } else { lang = "javascript"; } if ( lang ) { $this .addClass( "sunlight-highlight-" + lang ) .addClass( "linenums" ) .html( example.html() ); } } ); Sunlight.highlightAll( { lineNumbers : false, showMenu : true, enableDoclinks : true } ); } ); </script> <!--Navigation and Symbol Display--> <!--Google Analytics--> </body> </html>