README.md (2696B)
1 <!-- 2 3 @license Apache-2.0 4 5 Copyright (c) 2018 The Stdlib Authors. 6 7 Licensed under the Apache License, Version 2.0 (the "License"); 8 you may not use this file except in compliance with the License. 9 You may obtain a copy of the License at 10 11 http://www.apache.org/licenses/LICENSE-2.0 12 13 Unless required by applicable law or agreed to in writing, software 14 distributed under the License is distributed on an "AS IS" BASIS, 15 WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 16 See the License for the specific language governing permissions and 17 limitations under the License. 18 19 --> 20 21 # Async Iterator Symbol 22 23 > Async iterator [symbol][mdn-symbol] which specifies the default async iterator for an object. 24 25 <!-- Section to include introductory text. Make sure to keep an empty line after the intro `section` element and another before the `/section` close. --> 26 27 <section class="intro"> 28 29 </section> 30 31 <!-- /.intro --> 32 33 <!-- Package usage documentation. --> 34 35 <section class="usage"> 36 37 ## Usage 38 39 ```javascript 40 var AsyncIteratorSymbol = require( '@stdlib/symbol/async-iterator' ); 41 ``` 42 43 #### AsyncIteratorSymbol 44 45 Async iterator [`symbol`][mdn-symbol] which specifies the default async iterator for an object. 46 47 ```javascript 48 var s = typeof AsyncIteratorSymbol; 49 // e.g., returns 'symbol' 50 ``` 51 52 </section> 53 54 <!-- /.usage --> 55 56 <!-- Package usage notes. Make sure to keep an empty line after the `section` element and another before the `/section` close. --> 57 58 <section class="notes"> 59 60 ## Notes 61 62 - The [symbol][mdn-symbol] is only supported in environments which support [symbols][mdn-symbol] and async iterators. In non-supporting environments, the value is `null`. 63 64 </section> 65 66 <!-- /.notes --> 67 68 <!-- Package usage examples. --> 69 70 <section class="examples"> 71 72 ## Examples 73 74 <!-- eslint no-undef: "error" --> 75 76 ```javascript 77 var AsyncIteratorSymbol = require( '@stdlib/symbol/async-iterator' ); 78 79 if ( AsyncIteratorSymbol === null ) { 80 console.log( 'Environment does not support Symbol.asyncIterator.' ); 81 } else { 82 console.log( 'Environment does support Symbol.asyncIterator.' ); 83 } 84 ``` 85 86 </section> 87 88 <!-- /.examples --> 89 90 <!-- Section to include cited references. If references are included, add a horizontal rule *before* the section. Make sure to keep an empty line after the `section` element and another before the `/section` close. --> 91 92 <section class="references"> 93 94 </section> 95 96 <!-- /.references --> 97 98 <!-- Section for all links. Make sure to keep an empty line after the `section` element and another before the `/section` close. --> 99 100 <section class="links"> 101 102 [mdn-symbol]: https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Symbol 103 104 </section> 105 106 <!-- /.links -->