<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom" xmlns:dc="http://purl.org/dc/elements/1.1/">
  <channel>
    <title>DEV Community: spencer kelly</title>
    <description>The latest articles on DEV Community by spencer kelly (@spencermountain).</description>
    <link>https://dev.to/spencermountain</link>
    <image>
      <url>https://media2.dev.to/dynamic/image/width=90,height=90,fit=cover,gravity=auto,format=auto/https:%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Fuser%2Fprofile_image%2F80558%2F45206f02-1c98-4b37-871d-7b0534e14534.jpeg</url>
      <title>DEV Community: spencer kelly</title>
      <link>https://dev.to/spencermountain</link>
    </image>
    <atom:link rel="self" type="application/rss+xml" href="https://dev.to/feed/spencermountain"/>
    <language>en</language>
    <item>
      <title>Svelte without callbacks</title>
      <dc:creator>spencer kelly</dc:creator>
      <pubDate>Sun, 23 Aug 2020 19:55:16 +0000</pubDate>
      <link>https://dev.to/spencermountain/svelte-without-callbacks-59hl</link>
      <guid>https://dev.to/spencermountain/svelte-without-callbacks-59hl</guid>
      <description>&lt;p&gt;I've been doing front-end interviews this summer, which usually involve moving variables between React components. It's something I'm terrible at.&lt;/p&gt;

&lt;p&gt;For years, jQuery applications were denounced for causing &lt;em&gt;'spaghetti code'&lt;/em&gt; - where variables were scattered throughout different callbacks. It made reasoning about the application tricky.&lt;/p&gt;

&lt;p&gt;React was welcomed and celebrated for making state/life-cycle explicit. It's really been helpful. &lt;strong&gt;&lt;em&gt;Moving variables between components&lt;/em&gt;&lt;/strong&gt; though, feels like it was always awkward, and seems to get more convoluted every year.&lt;/p&gt;


&lt;blockquote class="ltag__twitter-tweet"&gt;

  &lt;div class="ltag__twitter-tweet__main"&gt;
    &lt;div class="ltag__twitter-tweet__header"&gt;
      &lt;img class="ltag__twitter-tweet__profile-image" src="https://res.cloudinary.com/practicaldev/image/fetch/s--MIvAPJ-i--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://pbs.twimg.com/profile_images/1268659839917408256/XrxRXwCd_normal.jpg" alt="Andrew Clark profile image"&gt;
      &lt;div class="ltag__twitter-tweet__full-name"&gt;
        Andrew Clark
      &lt;/div&gt;
      &lt;div class="ltag__twitter-tweet__username"&gt;
        @acdlite
      &lt;/div&gt;
      &lt;div class="ltag__twitter-tweet__twitter-logo"&gt;
        &lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--ir1kO05j--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://dev.to/assets/twitter-f95605061196010f91e64806688390eb1a4dbc9e913682e043eb8b1e06ca484f.svg" alt="twitter logo"&gt;
      &lt;/div&gt;
    &lt;/div&gt;
    &lt;div class="ltag__twitter-tweet__body"&gt;
      If I had a time machine, I’d go back to 2016, grab my younger self by the shoulders and scream “YES GLOBAL MUTABLE STATE IS BAD BUT LOCAL MUTATION IS FINE AND YOUR INCREASINGLY CONVOLUTED EFFORTS TO AVOID IT ARE NOT MERELY MISGUIDED BUT ALSO DRIVING YOUR COLLABORATORS TO MADNESS”
    &lt;/div&gt;
    &lt;div class="ltag__twitter-tweet__date"&gt;
      07:01 AM - 23 May 2019
    &lt;/div&gt;


    &lt;div class="ltag__twitter-tweet__actions"&gt;
      &lt;a href="https://twitter.com/intent/tweet?in_reply_to=1131455129276694528" class="ltag__twitter-tweet__actions__button"&gt;
        &lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--fFnoeFxk--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://dev.to/assets/twitter-reply-action-238fe0a37991706a6880ed13941c3efd6b371e4aefe288fe8e0db85250708bc4.svg" alt="Twitter reply action"&gt;
      &lt;/a&gt;
      &lt;a href="https://twitter.com/intent/retweet?tweet_id=1131455129276694528" class="ltag__twitter-tweet__actions__button"&gt;
        &lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--k6dcrOn8--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://dev.to/assets/twitter-retweet-action-632c83532a4e7de573c5c08dbb090ee18b348b13e2793175fea914827bc42046.svg" alt="Twitter retweet action"&gt;
      &lt;/a&gt;
      &lt;a href="https://twitter.com/intent/like?tweet_id=1131455129276694528" class="ltag__twitter-tweet__actions__button"&gt;
        &lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--SRQc9lOp--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://dev.to/assets/twitter-like-action-1ea89f4b87c7d37465b0eb78d51fcb7fe6c03a089805d7ea014ba71365be5171.svg" alt="Twitter like action"&gt;
      &lt;/a&gt;
    &lt;/div&gt;
  &lt;/div&gt;
&lt;/blockquote&gt;


&lt;p&gt;This is what drew me to &lt;strong&gt;Svelte&lt;/strong&gt; - you can change a variable &lt;em&gt;from-a-distance&lt;/em&gt; in a spooky way. It seems to get around the need for all the spaghetti:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight html"&gt;&lt;code&gt;&lt;span class="c"&gt;&amp;lt;!-- Parent.svelte --&amp;gt;&lt;/span&gt;
&lt;span class="nt"&gt;&amp;lt;script&amp;gt;&lt;/span&gt;
  &lt;span class="k"&gt;import&lt;/span&gt; &lt;span class="nx"&gt;Child&lt;/span&gt; &lt;span class="k"&gt;from&lt;/span&gt; &lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="s1"&gt;./child.svelte&lt;/span&gt;&lt;span class="dl"&gt;'&lt;/span&gt;
  &lt;span class="kd"&gt;let&lt;/span&gt; &lt;span class="nx"&gt;str&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="s1"&gt;init&lt;/span&gt;&lt;span class="dl"&gt;'&lt;/span&gt;
  &lt;span class="nx"&gt;setTimeout&lt;/span&gt;&lt;span class="p"&gt;(()&lt;/span&gt; &lt;span class="o"&gt;=&amp;gt;&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
    &lt;span class="nx"&gt;str&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="s1"&gt;changed&lt;/span&gt;&lt;span class="dl"&gt;'&lt;/span&gt;
  &lt;span class="p"&gt;},&lt;/span&gt; &lt;span class="mi"&gt;2500&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;
&lt;span class="nt"&gt;&amp;lt;/script&amp;gt;&lt;/span&gt;
&lt;span class="nt"&gt;&amp;lt;div&amp;gt;&lt;/span&gt;
  &lt;span class="nt"&gt;&amp;lt;Child&lt;/span&gt; &lt;span class="err"&gt;{&lt;/span&gt;&lt;span class="na"&gt;str&lt;/span&gt;&lt;span class="err"&gt;}&lt;/span&gt; &lt;span class="nt"&gt;/&amp;gt;&lt;/span&gt;
&lt;span class="nt"&gt;&amp;lt;/div&amp;gt;&lt;/span&gt;

&lt;span class="c"&gt;&amp;lt;!-- Child.svelte --&amp;gt;&lt;/span&gt;
&lt;span class="nt"&gt;&amp;lt;script&amp;gt;&lt;/span&gt;
  &lt;span class="k"&gt;export&lt;/span&gt; &lt;span class="kd"&gt;let&lt;/span&gt; &lt;span class="nx"&gt;str&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="dl"&gt;''&lt;/span&gt;
&lt;span class="nt"&gt;&amp;lt;/script&amp;gt;&lt;/span&gt;
&lt;span class="nt"&gt;&amp;lt;div&amp;gt;&lt;/span&gt;
  child: &lt;span class="nt"&gt;&amp;lt;b&amp;gt;&lt;/span&gt;{$str}&lt;span class="nt"&gt;&amp;lt;/b&amp;gt;&lt;/span&gt;
&lt;span class="nt"&gt;&amp;lt;/div&amp;gt;&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Here, the child's HTML updates automatically. It's actually quite a remarkable thing. It feels like half the code is missing.&lt;/p&gt;




&lt;h2&gt;
  
  
  There's no callbacks ...?
&lt;/h2&gt;

&lt;p&gt;I'll admit, I do sometimes get stuck on control-flow issues in Svelte. There can be some puzzlers. I sometimes find myself throwing-around callbacks when I shouldn't.&lt;/p&gt;

&lt;p&gt;Consider this example:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight html"&gt;&lt;code&gt;&lt;span class="nt"&gt;&amp;lt;script&amp;gt;&lt;/span&gt;
  &lt;span class="kd"&gt;let&lt;/span&gt; &lt;span class="nx"&gt;value&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="s1"&gt;foo&lt;/span&gt;&lt;span class="dl"&gt;'&lt;/span&gt;
&lt;span class="nt"&gt;&amp;lt;/script&amp;gt;&lt;/span&gt;
&lt;span class="nt"&gt;&amp;lt;div&amp;gt;&lt;/span&gt;
  &lt;span class="nt"&gt;&amp;lt;input&lt;/span&gt; &lt;span class="na"&gt;bind:value&lt;/span&gt; &lt;span class="nt"&gt;/&amp;gt;&lt;/span&gt;
  magical variable: &lt;span class="nt"&gt;&amp;lt;b&amp;gt;&lt;/span&gt;{value}&lt;span class="nt"&gt;&amp;lt;/b&amp;gt;&lt;/span&gt;
&lt;span class="nt"&gt;&amp;lt;/div&amp;gt;&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;This variable is 'hot' - it's wired-up both-ways. If you look at the source, there's &lt;code&gt;getElementById's&lt;/code&gt; and &lt;code&gt;addEventListener's&lt;/code&gt; - the stuff you've normally been writing yourself.&lt;/p&gt;




&lt;h2&gt;
  
  
  There's still no callbacks?
&lt;/h2&gt;

&lt;p&gt;When a parent passes a variable to a child, the child will  automatically listen for changes. The parent will only listen to the child if you use &lt;code&gt;bind&lt;/code&gt;:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight html"&gt;&lt;code&gt;&lt;span class="c"&gt;&amp;lt;!-- one-way (down) --&amp;gt;&lt;/span&gt;
&lt;span class="nt"&gt;&amp;lt;Child&lt;/span&gt; &lt;span class="na"&gt;str=&lt;/span&gt;&lt;span class="s"&gt;{str}&lt;/span&gt; &lt;span class="nt"&gt;/&amp;gt;&lt;/span&gt;
&lt;span class="c"&gt;&amp;lt;!-- both-ways --&amp;gt;&lt;/span&gt;
&lt;span class="nt"&gt;&amp;lt;Child&lt;/span&gt; &lt;span class="na"&gt;bind:str&lt;/span&gt; &lt;span class="nt"&gt;/&amp;gt;&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;A grandchild can change a variable using nested binds -&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;prop ➔ bind:prop ➔ bind:prop
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;A sibling can change a variable using two binds -&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;prop ➔ [bind:prop, bind:prop]
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;In both cases, things are updated between all the components &lt;em&gt;automatically&lt;/em&gt;, as though it were a spreadsheet.&lt;/p&gt;




&lt;p&gt;Ok - this &lt;code&gt;bind&lt;/code&gt; thing is crazy. It's automating a big-chunk of web-development. It's automating the chunk that sucks. I'm feeling it.&lt;/p&gt;

&lt;p&gt;Arguably, &lt;em&gt;bind&lt;/em&gt; also resolves a lot of those Redux job-interview questions that I mess up.&lt;/p&gt;




&lt;h2&gt;
  
  
  But what about callbacks though?
&lt;/h2&gt;

&lt;p&gt;I'm still a bit confused about this, admittedly. &lt;/p&gt;

&lt;p&gt;Svelte has a way that you can declare a variable with &lt;strong&gt;&lt;em&gt;$:&lt;/em&gt;&lt;/strong&gt; instead of &lt;strong&gt;&lt;em&gt;let&lt;/em&gt;&lt;/strong&gt; - and it enters the spooky dependency-graph - where it knows when variables change somehow.&lt;/p&gt;

&lt;p&gt;I don't fully get it, but it seems really powerful:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight html"&gt;&lt;code&gt;&lt;span class="c"&gt;&amp;lt;!-- Parent.svelte --&amp;gt;&lt;/span&gt;
&lt;span class="nt"&gt;&amp;lt;script&amp;gt;&lt;/span&gt;
  &lt;span class="k"&gt;import&lt;/span&gt; &lt;span class="nx"&gt;Child&lt;/span&gt; &lt;span class="k"&gt;from&lt;/span&gt; &lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="s1"&gt;./Child.svelte&lt;/span&gt;&lt;span class="dl"&gt;'&lt;/span&gt;
  &lt;span class="kd"&gt;let&lt;/span&gt; &lt;span class="nx"&gt;str&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="s1"&gt;init&lt;/span&gt;&lt;span class="dl"&gt;'&lt;/span&gt;
  &lt;span class="c1"&gt;// (fancy-part!)&lt;/span&gt;
  &lt;span class="nx"&gt;$&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="nx"&gt;strLen&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="p"&gt;()&lt;/span&gt; &lt;span class="o"&gt;=&amp;gt;&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
    &lt;span class="k"&gt;return&lt;/span&gt; &lt;span class="nx"&gt;str&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;length&lt;/span&gt;
  &lt;span class="p"&gt;}&lt;/span&gt;
&lt;span class="nt"&gt;&amp;lt;/script&amp;gt;&lt;/span&gt;
&lt;span class="nt"&gt;&amp;lt;div&amp;gt;&lt;/span&gt;
  &lt;span class="nt"&gt;&amp;lt;Child&lt;/span&gt; &lt;span class="na"&gt;bind:str&lt;/span&gt; &lt;span class="nt"&gt;/&amp;gt;&lt;/span&gt;
  {strLen()}
&lt;span class="nt"&gt;&amp;lt;/div&amp;gt;&lt;/span&gt;

&lt;span class="c"&gt;&amp;lt;!-- Child.svelte --&amp;gt;&lt;/span&gt;
&lt;span class="nt"&gt;&amp;lt;script&amp;gt;&lt;/span&gt;
  &lt;span class="k"&gt;export&lt;/span&gt; &lt;span class="kd"&gt;let&lt;/span&gt; &lt;span class="nx"&gt;str&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="dl"&gt;''&lt;/span&gt;
  &lt;span class="nx"&gt;setTimeout&lt;/span&gt;&lt;span class="p"&gt;(()&lt;/span&gt; &lt;span class="o"&gt;=&amp;gt;&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
    &lt;span class="nx"&gt;str&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="s1"&gt;child-changed&lt;/span&gt;&lt;span class="dl"&gt;'&lt;/span&gt;
  &lt;span class="p"&gt;},&lt;/span&gt; &lt;span class="mi"&gt;2000&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;
&lt;span class="nt"&gt;&amp;lt;/script&amp;gt;&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;The function will re-fire after the child component changes the variable - and then the DOM will magically update, too&lt;/p&gt;

&lt;p&gt;I mean, that's a callback. I just don't have to pass it around anymore. Using this &lt;strong&gt;$:&lt;/strong&gt; thing, you can listen for changes, whenever you want to - from the top, the bottom, or in a side component. No sweat.&lt;/p&gt;




&lt;h2&gt;
  
  
  Maybe there are callbacks
&lt;/h2&gt;

&lt;p&gt;These three aspects - &lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;the &lt;strong&gt;&lt;em&gt;'hot'&lt;/em&gt;&lt;/strong&gt; props (going down)&lt;/li&gt;
&lt;li&gt;the &lt;strong&gt;'bind'&lt;/strong&gt; concept (going up)&lt;/li&gt;
&lt;li&gt;the &lt;strong&gt;$:&lt;/strong&gt; thing (anywhere)&lt;/li&gt;
&lt;/ol&gt;

&lt;p&gt;They seem to be a complete interface. Maybe this is the interface we want to have for public libraries, and open-source components. I can't tell.&lt;/p&gt;

&lt;p&gt;There seems to be no gospel about what a Svelte component interface ought to look like. A lot of libraries accept props, and callbacks for each prop that changes. This &lt;em&gt;'events-up'&lt;/em&gt; callback style is cool with me too, I guess.&lt;/p&gt;

&lt;p&gt;Oh - there is also &lt;a href="https://svelte.dev/tutorial/writable-stores"&gt;the Store concept&lt;/a&gt;. This is a observable &lt;em&gt;sub/pup&lt;/em&gt; thing. I used stores a lot until I figured-out I didn't need them as much. They are more explicit and traditional about the variable updating.&lt;/p&gt;

&lt;p&gt;Maybe Svelte components should accept writable stores as props? That would look something like this:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight html"&gt;&lt;code&gt;&lt;span class="c"&gt;&amp;lt;!-- Parent.svelte --&amp;gt;&lt;/span&gt;
&lt;span class="nt"&gt;&amp;lt;script&amp;gt;&lt;/span&gt;
  &lt;span class="k"&gt;import&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt; &lt;span class="nx"&gt;writable&lt;/span&gt; &lt;span class="p"&gt;}&lt;/span&gt; &lt;span class="k"&gt;from&lt;/span&gt; &lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="s1"&gt;svelte/store&lt;/span&gt;&lt;span class="dl"&gt;'&lt;/span&gt;
  &lt;span class="k"&gt;import&lt;/span&gt; &lt;span class="nx"&gt;Child&lt;/span&gt; &lt;span class="k"&gt;from&lt;/span&gt; &lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="s1"&gt;./Child.svelte&lt;/span&gt;&lt;span class="dl"&gt;'&lt;/span&gt;
  &lt;span class="kd"&gt;let&lt;/span&gt; &lt;span class="nx"&gt;str&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="nx"&gt;writable&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="s1"&gt;init&lt;/span&gt;&lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;
  &lt;span class="nx"&gt;str&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;subscribe&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nx"&gt;wowChanged&lt;/span&gt; &lt;span class="o"&gt;=&amp;gt;&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
    &lt;span class="c1"&gt;// is this a callback?&lt;/span&gt;
  &lt;span class="p"&gt;})&lt;/span&gt;
&lt;span class="nt"&gt;&amp;lt;/script&amp;gt;&lt;/span&gt;
&lt;span class="nt"&gt;&amp;lt;div&amp;gt;&lt;/span&gt;
  &lt;span class="nt"&gt;&amp;lt;Child&lt;/span&gt; &lt;span class="err"&gt;{&lt;/span&gt;&lt;span class="na"&gt;str&lt;/span&gt;&lt;span class="err"&gt;}&lt;/span&gt; &lt;span class="nt"&gt;/&amp;gt;&lt;/span&gt;
&lt;span class="nt"&gt;&amp;lt;/div&amp;gt;&lt;/span&gt;

&lt;span class="c"&gt;&amp;lt;!-- Child.svelte --&amp;gt;&lt;/span&gt;
&lt;span class="nt"&gt;&amp;lt;script&amp;gt;&lt;/span&gt;
  &lt;span class="k"&gt;export&lt;/span&gt; &lt;span class="kd"&gt;let&lt;/span&gt; &lt;span class="nx"&gt;str&lt;/span&gt;
  &lt;span class="nx"&gt;setTimeout&lt;/span&gt;&lt;span class="p"&gt;(()&lt;/span&gt; &lt;span class="o"&gt;=&amp;gt;&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
    &lt;span class="nx"&gt;$str&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="s1"&gt;child-changed&lt;/span&gt;&lt;span class="dl"&gt;'&lt;/span&gt; &lt;span class="c1"&gt;//change store&lt;/span&gt;
  &lt;span class="p"&gt;},&lt;/span&gt; &lt;span class="mi"&gt;2000&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;
&lt;span class="nt"&gt;&amp;lt;/script&amp;gt;&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;I guess that's cool too.&lt;/p&gt;

&lt;p&gt;Oh, and there's &lt;a href="https://svelte.dev/tutorial/context-api"&gt;a Context concept&lt;/a&gt; too, which avoids having to pass props down all-together. That seems cool.&lt;/p&gt;

&lt;p&gt;Oh, and there's &lt;a href="https://www.reddit.com/r/sveltejs/comments/ekttox/how_to_add_redux_to_svelte/"&gt;a ton of people&lt;/a&gt; adding redux back to svelte (for some reason). That seems cool.&lt;/p&gt;

&lt;p&gt;The svelte developers are also building this &lt;em&gt;galaxy-brain&lt;/em&gt; Multi-Page-App thing &lt;em&gt;&lt;a href="https://github.com/sveltejs/sapper"&gt;called Sapper&lt;/a&gt;&lt;/em&gt; which routes data around components presumably, too. Cool.&lt;/p&gt;

&lt;p&gt;It's all cool. Svelte is a really fun, and flexible library to use. I hope this message-passing stuff becomes clearer, as more people jump in. I'd like to not have to think about it anymore.&lt;/p&gt;

</description>
      <category>svelte</category>
    </item>
  </channel>
</rss>
