<?xml version="1.0" encoding="utf-8" ?><rss version="2.0" xml:base="http://tech.saigonist.com/taxonomy/term/47/all" xmlns:dc="http://purl.org/dc/elements/1.1/">
  <channel>
    <title>es6</title>
    <link>http://tech.saigonist.com/taxonomy/term/47/all</link>
    <description></description>
    <language>en</language>
          <item>
    <title>Scala vs Javascript (ES6, TypeScript, Node.js)</title>
    <link>http://tech.saigonist.com/b/code/scala-vs-javascript-es6-typescript-nodejs</link>
    <description>&lt;span class=&quot;submitted-by&quot;&gt;March 5, 2016&lt;/span&gt;&lt;div class=&quot;field_tags&quot;&gt;&lt;span class=&quot;label label-info&quot;&gt;&lt;a href=&quot;/tags/scala&quot;&gt;scala&lt;/a&gt;&lt;/span&gt; &lt;span class=&quot;label label-info&quot;&gt;&lt;a href=&quot;/tags/javascript&quot;&gt;javascript&lt;/a&gt;&lt;/span&gt; &lt;span class=&quot;label label-info&quot;&gt;&lt;a href=&quot;/tags/typescript&quot;&gt;typescript&lt;/a&gt;&lt;/span&gt; &lt;span class=&quot;label label-info&quot;&gt;&lt;a href=&quot;/tags/es6&quot;&gt;es6&lt;/a&gt;&lt;/span&gt; &lt;span class=&quot;label label-info&quot;&gt;&lt;a href=&quot;/tags/nodejs&quot;&gt;node.js&lt;/a&gt;&lt;/span&gt; &lt;/div&gt;&lt;div class=&quot;field field-name-body field-type-text-with-summary field-label-hidden&quot;&gt;&lt;div class=&quot;field-items&quot;&gt;&lt;div class=&quot;field-item even&quot;&gt;&lt;p&gt;Now with Scala.js allowing isomorphic Scala code to run on both browser and server. Scala contends with JavaScript in the web domain. But assuming we are talking about web, how do the two languages compare?&lt;/p&gt;

&lt;p&gt;First, JavaScript comes in a few flavors. There&#039;s ES5 which is currently running in all browsers. There&#039;s Node.js, which is the same Google V8 JavaScript engine but running outside the browser and thus without browser/web apis included, but which can run ES6 (EcmaScript 6). And then there are the many languages that compile or transpile down to plain old ES5 JavaScript,...&lt;/p&gt;&lt;/div&gt;&lt;/div&gt;&lt;/div&gt;</description>
     <pubDate>Sat, 05 Mar 2016 06:22:01 +0000</pubDate>
 <dc:creator>tomo</dc:creator>
 <guid isPermaLink="false">57 at http://tech.saigonist.com</guid>
  </item>
  <item>
    <title>Python-like List Comprehensions in JavaScript</title>
    <link>http://tech.saigonist.com/b/code/python-list-comprehensions-javascript</link>
    <description>&lt;span class=&quot;submitted-by&quot;&gt;March 4, 2016&lt;/span&gt;&lt;div class=&quot;field_tags&quot;&gt;&lt;span class=&quot;label label-info&quot;&gt;&lt;a href=&quot;/tags/javascript&quot;&gt;javascript&lt;/a&gt;&lt;/span&gt; &lt;span class=&quot;label label-info&quot;&gt;&lt;a href=&quot;/tags/es6&quot;&gt;es6&lt;/a&gt;&lt;/span&gt; &lt;span class=&quot;label label-info&quot;&gt;&lt;a href=&quot;/tags/python&quot;&gt;python&lt;/a&gt;&lt;/span&gt; &lt;span class=&quot;label label-info&quot;&gt;&lt;a href=&quot;/tags/functional&quot;&gt;functional&lt;/a&gt;&lt;/span&gt; &lt;span class=&quot;label label-info&quot;&gt;&lt;a href=&quot;/tags/lambda&quot;&gt;lambda&lt;/a&gt;&lt;/span&gt; &lt;/div&gt;&lt;div class=&quot;field field-name-body field-type-text-with-summary field-label-hidden&quot;&gt;&lt;div class=&quot;field-items&quot;&gt;&lt;div class=&quot;field-item even&quot;&gt;&lt;p&gt;Python has a neat syntactic feature where you can take a literal list constructor&#039;s bracket notation (e.g. &lt;code&gt;[2, 4, 6, 8, 10]&lt;/code&gt;) but have code statements generate the list&#039;s contents. So instead of writing out the 5 even numbers in the example, one could write &lt;code&gt;[(x+1)*2 for x in range(5)]&lt;/code&gt; which turns out to be more characters but you can imagine the savings if the series in the list was longer. Instead of &lt;code&gt;range()&lt;/code&gt; we could have a literal list &lt;code&gt;[0, 1, 2, 3, 4]&lt;/code&gt; or even a generator function, anything which is iterable.&lt;/p&gt;

&lt;p&gt;How could we do this...&lt;/p&gt;&lt;/div&gt;&lt;/div&gt;&lt;/div&gt;</description>
     <pubDate>Thu, 03 Mar 2016 17:19:43 +0000</pubDate>
 <dc:creator>tomo</dc:creator>
 <guid isPermaLink="false">51 at http://tech.saigonist.com</guid>
  </item>
  <item>
    <title>Creating forms with callbacks in React+Redux</title>
    <link>http://tech.saigonist.com/b/code/creating-forms-callbacks-reactredux</link>
    <description>&lt;span class=&quot;submitted-by&quot;&gt;February 21, 2016&lt;/span&gt;&lt;div class=&quot;field_tags&quot;&gt;&lt;span class=&quot;label label-info&quot;&gt;&lt;a href=&quot;/tags/react&quot;&gt;react&lt;/a&gt;&lt;/span&gt; &lt;span class=&quot;label label-info&quot;&gt;&lt;a href=&quot;/tags/redux&quot;&gt;redux&lt;/a&gt;&lt;/span&gt; &lt;span class=&quot;label label-info&quot;&gt;&lt;a href=&quot;/tags/es6&quot;&gt;es6&lt;/a&gt;&lt;/span&gt; &lt;span class=&quot;label label-info&quot;&gt;&lt;a href=&quot;/tags/javascript&quot;&gt;javascript&lt;/a&gt;&lt;/span&gt; &lt;/div&gt;&lt;div class=&quot;field field-name-body field-type-text-with-summary field-label-hidden&quot;&gt;&lt;div class=&quot;field-items&quot;&gt;&lt;div class=&quot;field-item even&quot;&gt;&lt;p&gt;In React, you have some simple/dumb components which are just html and other components and maybe render some values which are passed in. It becomes a little trickier when you want to add some functionality to the component, such as form elements - inputs and buttons and submit actions. What I mean by &quot;forms with callbacks&quot; is that you want to execute some JavaScript and also change state in your React app, but do so without giving direct access to state to the component. Instead here&#039;s one way to do it.&lt;/p&gt;

&lt;ol&gt;&lt;li&gt;Draw out the HTML (don&#039;t worry about using React components yet) in JSX&lt;/li&gt;...&lt;/ol&gt;&lt;/div&gt;&lt;/div&gt;&lt;/div&gt;</description>
     <pubDate>Sat, 20 Feb 2016 18:06:33 +0000</pubDate>
 <dc:creator>tomo</dc:creator>
 <guid isPermaLink="false">34 at http://tech.saigonist.com</guid>
  </item>
  <item>
    <title> Quick explanation of JavaScript Promises</title>
    <link>http://tech.saigonist.com/b/code/quick-explanation-javascript-promises</link>
    <description>&lt;span class=&quot;submitted-by&quot;&gt;February 14, 2016&lt;/span&gt;&lt;div class=&quot;field_tags&quot;&gt;&lt;span class=&quot;label label-info&quot;&gt;&lt;a href=&quot;/tags/es6&quot;&gt;es6&lt;/a&gt;&lt;/span&gt; &lt;span class=&quot;label label-info&quot;&gt;&lt;a href=&quot;/tags/javascript&quot;&gt;javascript&lt;/a&gt;&lt;/span&gt; &lt;span class=&quot;label label-info&quot;&gt;&lt;a href=&quot;/tags/promises&quot;&gt;promises&lt;/a&gt;&lt;/span&gt; &lt;/div&gt;&lt;div class=&quot;field field-name-body field-type-text-with-summary field-label-hidden&quot;&gt;&lt;div class=&quot;field-items&quot;&gt;&lt;div class=&quot;field-item even&quot;&gt;&lt;h2&gt;&quot;JavaScript Promises: reason about async events, serially chain them, reduce them. General replacement for XHR&quot;&lt;/h2&gt;

&lt;p&gt;What is a promise? Conceptually and outside the context of code, a promise is either a willful intention of achieving a result or a promise is considered the actual result itself. EcmaScript 6 (ES6) introduces the Promises API which is currently implemented by most browsers (and Edge but not IE according to &lt;a href=&quot;http://caniuse.com/#feat=promises&quot;&gt;caniuse.com&lt;/a&gt; - but there&#039;s a polyfill for that). So a JavaScript Promise is simply an object of some callback...&lt;/p&gt;&lt;/div&gt;&lt;/div&gt;&lt;/div&gt;</description>
     <pubDate>Sun, 14 Feb 2016 16:27:08 +0000</pubDate>
 <dc:creator>tomo</dc:creator>
 <guid isPermaLink="false">33 at http://tech.saigonist.com</guid>
  </item>
  <item>
    <title>JavaScript&#039;s Symbol Type (ECMAScript 6)</title>
    <link>http://tech.saigonist.com/b/code/javascripts-symbol-type-ecmascript-6</link>
    <description>&lt;span class=&quot;submitted-by&quot;&gt;December 27, 2015&lt;/span&gt;&lt;div class=&quot;field_tags&quot;&gt;&lt;span class=&quot;label label-info&quot;&gt;&lt;a href=&quot;/tags/javascript&quot;&gt;javascript&lt;/a&gt;&lt;/span&gt; &lt;span class=&quot;label label-info&quot;&gt;&lt;a href=&quot;/tags/es6&quot;&gt;es6&lt;/a&gt;&lt;/span&gt; &lt;/div&gt;&lt;div class=&quot;field field-name-body field-type-text-with-summary field-label-hidden&quot;&gt;&lt;div class=&quot;field-items&quot;&gt;&lt;div class=&quot;field-item even&quot;&gt;&lt;p&gt;JavaScript is not a strongly-typed language like many classic compiled languages. Instead, like many scripting languages, it is loosely typed and has just a few basic types: number, string, object, boolean. There are also two types which are used as values (rather than to hold varying values like numbers and strings) which are null (no value) and undefined (the initial or undefined value of a variable). JavaScript is aware of Arrays as a type of object, but is still an object and not a separate type. Objects in JavaScript take prototypical inheritence. A literal object looks like a Python...&lt;/p&gt;&lt;/div&gt;&lt;/div&gt;&lt;/div&gt;</description>
     <pubDate>Sun, 27 Dec 2015 04:30:00 +0000</pubDate>
 <dc:creator>tomo</dc:creator>
 <guid isPermaLink="false">23 at http://tech.saigonist.com</guid>
  </item>
  </channel>
</rss>
