<?xml version="1.0" encoding="UTF-8"?><rss xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:atom="http://www.w3.org/2005/Atom" version="2.0" xmlns:cc="http://cyber.law.harvard.edu/rss/creativeCommonsRssModule.html">
    <channel>
        <title><![CDATA[Stories by Daniel Noordegraaf on Medium]]></title>
        <description><![CDATA[Stories by Daniel Noordegraaf on Medium]]></description>
        <link>https://medium.com/@dannynoo?source=rss-5a6fcff4dbd8------2</link>
        <image>
            <url>https://cdn-images-1.medium.com/fit/c/150/150/1*p4Trri5g4aQgtIpQDq_5Xw.png</url>
            <title>Stories by Daniel Noordegraaf on Medium</title>
            <link>https://medium.com/@dannynoo?source=rss-5a6fcff4dbd8------2</link>
        </image>
        <generator>Medium</generator>
        <lastBuildDate>Thu, 19 Nov 2026 09:45:22 GMT</lastBuildDate>
        <atom:link href="https://medium.com/@dannynoo/feed" rel="self" type="application/rss+xml"/>
        <webMaster><![CDATA[yourfriends@medium.com]]></webMaster>
        <atom:link href="http://medium.superfeedr.com/" rel="hub"/>
        <item>
            <title><![CDATA[The Difference Between RxJS Operators: zip() and forkJoin()]]></title>
            <link>https://medium.com/@dannynoo/the-difference-between-rxjs-operators-zip-and-forkjoin-60867f66dcd8?source=rss-5a6fcff4dbd8------2</link>
            <guid isPermaLink="false">https://medium.com/p/60867f66dcd8</guid>
            <category><![CDATA[front-end-development]]></category>
            <category><![CDATA[javascript]]></category>
            <category><![CDATA[observables]]></category>
            <category><![CDATA[rxjs]]></category>
            <category><![CDATA[angular]]></category>
            <dc:creator><![CDATA[Daniel Noordegraaf]]></dc:creator>
            <pubDate>Wed, 01 Feb 2023 20:48:57 GMT</pubDate>
            <atom:updated>2023-02-01T20:48:57.299Z</atom:updated>
            <content:encoded><![CDATA[<p>I’ve had to search for a clear answer to this a few times so I’d like to post this for my own clarity, I hope it helps anyone else with this specific question as well.</p><p>zip and forkJoin are both operators in the ReactiveX (RxJS) library, used for combining multiple Observables into a single one. However, they serve different purposes and have different behaviours.</p><p>zip combines the values emitted by multiple Observables and emits an array of values, where the nth value in the array is the result of combining the nth value from each of the input Observables. The zip operator will only emit a value once all the source Observables have emitted at least one value. The operator will continue to emit values as long as any of the source Observables continue to emit values.</p><p>forkJoin, on the other hand, waits for all of the input Observables to complete and then emits an array of their final values. If any of the input Observables errors, the forkJoin observable will immediately error with the same error.</p><p>The main difference between zip and forkJoin is that zip combines values on an ongoing basis, while forkJoin only emits values after all of the input Observables have been completed.</p><p>I think that a small code example can help to illustrate this:</p><pre>import { zip, forkJoin, of } from &#39;rxjs&#39;;<br><br>// Example of zip<br>const first = of(1, 2, 3);<br>const second = of(4, 5, 6);<br>const zipResult = zip(first, second);<br>zipResult.subscribe(val =&gt; console.log(val));<br>// Output: [1, 4], [2, 5], [3, 6]<br><br>// Example of forkJoin<br>const first = of(1, 2, 3);<br>const second = of(4, 5, 6);<br>const forkJoinResult = forkJoin(first, second);<br>forkJoinResult.subscribe(val =&gt; console.log(val));<br>// Output: [3, 6]</pre><p>In the zip example, we combine the values from two observables (first and second) into a new observable zipResult. The zip operator waits until both observables have emitted a value, then it combines these values into an array and emits the array. This process is repeated until both observables have been completed.</p><p>In the forkJoinexample, we combine the values from two observables (first and second) into a new observable forkJoinResult. The forkJoin operator waits until both observables have completed, then it emits an array with the latest values from each observable.</p><p>Note that if either of the source observables errors, the forkJoin operator will immediately error with the same error, effectively terminating the combined observable.</p><p>Chances are if you’re reading this that you probably just need the forkJoin operator to fulfill your needs. I will probably find myself reading this article in a few years because I forgot what the zip operator does, again.</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=60867f66dcd8" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Don’t use Take(1) to Unsubscribe From Your Observables]]></title>
            <link>https://medium.com/@dannynoo/dont-use-take-1-to-unsubscribe-from-your-observables-99545f04a4f0?source=rss-5a6fcff4dbd8------2</link>
            <guid isPermaLink="false">https://medium.com/p/99545f04a4f0</guid>
            <category><![CDATA[angular]]></category>
            <category><![CDATA[javascript]]></category>
            <category><![CDATA[reactive-programming]]></category>
            <category><![CDATA[typescript]]></category>
            <category><![CDATA[rxjs]]></category>
            <dc:creator><![CDATA[Daniel Noordegraaf]]></dc:creator>
            <pubDate>Fri, 27 Jan 2023 15:17:37 GMT</pubDate>
            <atom:updated>2023-01-27T15:17:37.589Z</atom:updated>
            <content:encoded><![CDATA[<p>The take(1) operator in RxJS is something you might want to avoid using in your code. The idea behind it is that it unsubscribes from an observable after the first value is emitted. But, using it can lead to some confusing and unexpected behavior. For example, if you&#39;re listening to an event stream, and you use take(1), you&#39;ll only get the first event and miss all the others.</p><p>In Angular, if you use take(1) on an observable in a template binding, the component will not automatically unsubscribe from the observable when the component is destroyed. This can lead to memory leaks, which are bad, nobody likes those. Instead, you can use the takeUntil() operator, which unsubscribes from an observable based on another observable, like when the component is destroyed. Just remember to unsubscribe your observables in the ngOnDestroy() lifecycle hook to prevent memory leaks.</p><p>Here’s my example of how to properly use takeUntil() by observing a subject in the component.</p><pre>import { Component, OnInit, OnDestroy } from &#39;@angular/core&#39;;<br>import { DataService } from &#39;../data.service&#39;;<br>import { takeUntil } from &#39;rxjs/operators&#39;;<br>import { Subject } from &#39;rxjs&#39;;<br><br>@Component({<br>  selector: &#39;app-home&#39;,<br>  templateUrl: &#39;./home.component.html&#39;,<br>  styleUrls: [&#39;./home.component.css&#39;]<br>})<br>export class HomeComponent implements OnInit, OnDestroy {<br><br>  items = [];<br>  unsubscribe$: Subject&lt;boolean&gt; = new Subject&lt;boolean&gt;();<br>  <br>  constructor(private service: DataService) { }<br>  <br>  ngOnInit() {<br>    this.service.sendGetRequest().pipe(takeUntil(this.unsubscribe$))<br>    .subscribe((data: any[])=&gt;{<br>      console.log(data);<br>      this.items = data;<br>    })<br>  }<br>  ngOnDestroy() {<br>    this.unsubscribe$.next(true);<br>    // Unsubscribe from the subject<br>    this.unsubscribe$.unsubscribe();<br>  }<br>}</pre><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=99545f04a4f0" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[How you Should be Using Type Coercion in JavaScript]]></title>
            <link>https://medium.com/@dannynoo/how-you-should-be-using-type-coercion-in-javascript-314423344139?source=rss-5a6fcff4dbd8------2</link>
            <guid isPermaLink="false">https://medium.com/p/314423344139</guid>
            <category><![CDATA[coding]]></category>
            <category><![CDATA[javascript]]></category>
            <category><![CDATA[code]]></category>
            <category><![CDATA[web-development]]></category>
            <category><![CDATA[programming]]></category>
            <dc:creator><![CDATA[Daniel Noordegraaf]]></dc:creator>
            <pubDate>Sun, 15 Jan 2023 23:35:46 GMT</pubDate>
            <atom:updated>2023-01-15T23:35:46.260Z</atom:updated>
            <content:encoded><![CDATA[<figure><img alt="Coffee cup on desk with computer and sign that says ‘no bad days’" src="https://cdn-images-1.medium.com/max/1024/0*lYDHo1gOdmSnw-AG" /><figcaption>Photo by <a href="https://unsplash.com/@ryland_dean?utm_source=medium&amp;utm_medium=referral">Ryland Dean</a> on <a href="https://unsplash.com/?utm_source=medium&amp;utm_medium=referral">Unsplash</a></figcaption></figure><p>“Why did the programmer force his variables to change types? Because he wanted to show them who’s boss!”</p><p>Type coercion in JavaScript refers to the process of converting a value from one data type to another. This can happen automatically in certain situations, such as when using the + operator to add a number and a string together. It can also be done explicitly using methods such as Number(), String(), and Boolean().</p><p>Here are a handful of type coercion examples that you might see out in the wild:</p><p>Coercion changing a number to a string:</p><pre>let num = 5;<br>let str = &quot;5&quot;;<br>console.log(num + str); // &quot;55&quot;</pre><p>Here, the + operator is used to add a number and a string together. Since the + operator is not just for arithmetic but also for concatenation, JavaScript automatically converts the number to a string so it can be concatenated with the other string.</p><p>Converting a string to a number so we can get mathy:</p><pre>let num = 5;<br>let str = &quot;5&quot;;<br>console.log(Number(str) + num); // 10</pre><p>We use the Number() method to explicitly convert the string “5” to a number. This allows us to perform arithmetic with it and the variable num.</p><p>Boolean conversion:</p><pre>let num = 0;<br>let str = &quot;false&quot;;<br>console.log(Boolean(num) &amp;&amp; str); // false</pre><p>In this example, we use the Boolean() method to explicitly convert the number 0 to a boolean value. We then use the logical operator &amp;&amp; to check if the boolean value is true and the string “false” . Since the first operand is false, the whole expression evaluates to false.</p><p>More on coerced booleans:</p><pre>let str = &quot;&quot;;<br>console.log(!str); // true</pre><p>We can use the “!” operator to negate the value of the variable str. An empty string is also considered a falsy value in JavaScript, so negating it with the “!” operator will convert it to true.</p><p>The “!” operator will only coerce the value to a boolean, it will not change the type of the variable. It’s also worth noting that not all values will be coerced to true or false, for instance, when using an object as an operand it will always be coerced to true.</p><p>Type coercion can sometimes lead to unexpected results, so it’s best to use it deliberately and with caution. Understanding the rules of type coercion and testing your code thoroughly can help you avoid any issues.</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=314423344139" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[How to Fight Dementia with Web Development]]></title>
            <link>https://medium.com/@dannynoo/how-to-fight-dementia-with-web-development-8a05992309a6?source=rss-5a6fcff4dbd8------2</link>
            <guid isPermaLink="false">https://medium.com/p/8a05992309a6</guid>
            <category><![CDATA[career-change]]></category>
            <category><![CDATA[motivation]]></category>
            <category><![CDATA[web-development]]></category>
            <category><![CDATA[alzheimers]]></category>
            <category><![CDATA[juno-college]]></category>
            <dc:creator><![CDATA[Daniel Noordegraaf]]></dc:creator>
            <pubDate>Wed, 01 Sep 2021 01:14:45 GMT</pubDate>
            <atom:updated>2021-09-01T01:14:45.284Z</atom:updated>
            <content:encoded><![CDATA[<p>There are a lot of good reasons to transition into a career in technology. The pay is pretty good, the work-life balance is arguably better than most industries, and you get to work collaboratively building cool things! But when I was pressed recently to give my primary motivating factor for transitioning into a career in web development, I knew immediately that my answer was a little bit different, and it requires some context.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*Fa8far5scpxA7TzeAclEaA.jpeg" /></figure><p>My paternal grandfather died of Alzheimer’s disease in 2007. My father was beaten by the same disease in April of this year. It’s worth mentioning that my maternal grandmother suffers from dementia as well. A hereditary connection to early-onset Alzheimer’s and dementia is suspected,¹ but that’s not why I’m sharing this information. I am doing it less to convey a sense of impending doom and more to talk about how it affects my perception of later life and my decisions in the present. Let’s say degenerative brain disease is creeping around the corner, what things can I do now to delay it and how do I make the most of my working life from this point forward? These questions have led me to re-imagine what a successful career looks like.</p><p>New studies have shown that learning a second language can work to delay the onset of Alzheimer’s symptoms.² My immediate thought when reading this was that I should download Duo Lingo and start learning Spanish as soon as possible. After a bit more gestation, though, all signs started to point toward software development. The ever-changing nature of the software world means that continuous learning and improvement are a non-negotiable part of a career in the sector. If one of my metrics for a successful career is retiring with a healthy brain then I am looking in the right direction. Software development comes with lifelong learning baked into it. Instead of learning Italian in my 50’s and maybe using it once or twice on vacation, I can learn Rust and get much more practical and consistent use out of the language, further strengthening those neural pathways that are created by learning a new language. And by then I’ll probably be able to use Rust to order a meal in a Venetian restaurant anyway.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*iUM1yJYDIF_3-Hbs-ytRrA.jpeg" /></figure><p>I’ve decided to expedite the process of starting a career in software by taking Juno’s immersive web development boot camp. Over the course of a few weeks, I contacted and applied to a few different boot camps here in Toronto. I ended up choosing Juno because it seemed like their staff were more engaged in the admissions process and also because it was just a much more strenuous application process. My thinking was that if it was harder to get accepted into Juno then it was less likely to be a factory churning out low-quality developers. My first impressions are that I’ve made the right choice: the staff are warm and helpful and the pace of the course material is rigorous. I’ll report back to share possibly my secondary and tertiary motivating factors for entering the world of tech, and maybe even some code!</p><h3>Sources</h3><p>[1]<a href="https://www.alz.org/alzheimers-dementia/what-is-alzheimers/causes-and-risk-factors/genetics"> </a><a href="https://www.alz.org/alzheimers-dementia/what-is-alzheimers/causes-and-risk-factors/genetics">https://www.alz.org/alzheimers-dementia/what-is-alzheimers/causes-and-risk-factors/genetics</a></p><p>[2]<a href="https://www.newscientist.com/article/dn24537-learn-another-language-to-delay-three-dementias/">https://www.newscientist.com/article/dn24537-learn-another-language-to-delay-three-dementias/</a></p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=8a05992309a6" width="1" height="1" alt="">]]></content:encoded>
        </item>
    </channel>
</rss>