<?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: Tom</title>
    <description>The latest articles on DEV Community by Tom (@ludder).</description>
    <link>https://dev.to/ludder</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%2F508235%2Ffdddaeb5-a63e-4727-ad50-9ffa1a0d8688.jpeg</url>
      <title>DEV Community: Tom</title>
      <link>https://dev.to/ludder</link>
    </image>
    <atom:link rel="self" type="application/rss+xml" href="https://dev.to/feed/ludder"/>
    <language>en</language>
    <item>
      <title>TIL: Auto push new branches</title>
      <dc:creator>Tom</dc:creator>
      <pubDate>Tue, 13 Sep 2022 13:36:45 +0000</pubDate>
      <link>https://dev.to/ludder/til-auto-push-new-branches-ong</link>
      <guid>https://dev.to/ludder/til-auto-push-new-branches-ong</guid>
      <description>&lt;p&gt;Add the following line to the &lt;code&gt;config&lt;/code&gt; file in your &lt;code&gt;.git&lt;/code&gt; folder (or to your global git config) to auto push a new branch you've created locally:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight properties"&gt;&lt;code&gt;&lt;span class="err"&gt;[push]&lt;/span&gt;
    &lt;span class="py"&gt;autoSetupRemote&lt;/span&gt; &lt;span class="p"&gt;=&lt;/span&gt; &lt;span class="s"&gt;true&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Now, on the first time you enter &lt;code&gt;git push&lt;/code&gt; for a new branch your terminal won't complain that the remote doesn't exist, it just pushes your branch.&lt;/p&gt;

</description>
      <category>git</category>
    </item>
    <item>
      <title>Dependabot needs a workflow too</title>
      <dc:creator>Tom</dc:creator>
      <pubDate>Sat, 06 Nov 2021 13:18:11 +0000</pubDate>
      <link>https://dev.to/ludder/dependabot-needs-a-workflow-too-2321</link>
      <guid>https://dev.to/ludder/dependabot-needs-a-workflow-too-2321</guid>
      <description>&lt;p&gt;Modern JavaScript projects tend to have a lot of external dependencies. It's important to keep those dependencies up to date. &lt;a href="https://docs.github.com/en/code-security/supply-chain-security/keeping-your-dependencies-updated-automatically"&gt;Dependabot&lt;/a&gt; is a great help in this. However, using Dependabot comes with new challenges:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;If your project has a lot of dependencies, Dependabot is creating new PR's on a daily basis. Who's responsible for dealing with them?&lt;/li&gt;
&lt;li&gt;Can we automatically merge PR's created by Dependabot or should we test them (locally)?&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;Our team came to the conclusion that Dependabot indeed helps us keeping the dependencies up to date, but that's not enough: Dependabot needs a workflow too. This is how we do it:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;A developer who is creating a new PR, should at the same time have a look at the existing open PR's, including the PR's opened by dependabot.&lt;/li&gt;
&lt;li&gt;We &lt;a href="https://github.com/marketplace/actions/dependabot-auto-merge"&gt;automatically merge&lt;/a&gt; patch PR's.&lt;/li&gt;
&lt;li&gt;Patch update, but failing tests? Checkout locally, check why tests are failing, fix, push and merge.&lt;/li&gt;
&lt;li&gt;Minor update and dev-dependency (and tests are green)? Just merge.&lt;/li&gt;
&lt;li&gt;All other type of PR's: checkout locally and test.&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;Notes:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;If there are 5 open dependabot PR's, it's not your responsibility to tackle them all. Just review 1 or 2, and leave the rest to the next developer.&lt;/li&gt;
&lt;li&gt;If Dependabot keeps on creating the maximum number of PR's several days in a row, we sometimes just run &lt;a href="https://www.npmjs.com/package/npm-check"&gt;&lt;code&gt;npm-check update&lt;/code&gt;&lt;/a&gt; to test and update a bunch of packages at the same time. (This is basically the workflow of projects without dependabot and the problem with that approach was that actually nobody was updating the dependencies at all.)&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;Keep your dependencies up to date, but share the burden across your team.&lt;/p&gt;

&lt;p&gt;Happy updating!&lt;/p&gt;

</description>
      <category>github</category>
      <category>dependabot</category>
    </item>
    <item>
      <title>Contain scrolling, contain reading</title>
      <dc:creator>Tom</dc:creator>
      <pubDate>Sun, 31 Oct 2021 15:03:35 +0000</pubDate>
      <link>https://dev.to/ludder/contain-scrolling-contain-reading-30l2</link>
      <guid>https://dev.to/ludder/contain-scrolling-contain-reading-30l2</guid>
      <description>&lt;p&gt;2 interesting articles in &lt;a href="https://frontendfoc.us/issues/514"&gt;this week's Frontend Focus&lt;/a&gt;.&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;Contain scrolling behavior&lt;/li&gt;
&lt;/ol&gt;

&lt;p&gt;When you add scrolling behavior to a certain container you sometimes do not want to continue scrolling when you reach the end of the container. This can be achieved with by setting the CSS &lt;code&gt;overscroll-behavior&lt;/code&gt; property to &lt;code&gt;contain&lt;/code&gt;. Read more in &lt;a href="https://ishadeed.com/article/prevent-scroll-chaining-overscroll-behavior/"&gt;Prevent Scroll Chaining With Overscroll Behavior&lt;/a&gt;. &lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;Restrict width of text container&lt;/li&gt;
&lt;/ol&gt;

&lt;p&gt;Swyx reminds us about the simple &lt;code&gt;max-width: 70ch;&lt;/code&gt; property to keep texts readable on large screens. He also links to some bookmarklets so you can apply readability to whatever website (for example Wikipedia): &lt;a href="https://www.swyx.io/css-100-bytes/"&gt;100 Bytes of CSS to look great everywhere&lt;/a&gt;.&lt;/p&gt;

</description>
      <category>css</category>
      <category>webdev</category>
    </item>
    <item>
      <title>Sort Carbon's DataTable with a backend API</title>
      <dc:creator>Tom</dc:creator>
      <pubDate>Tue, 24 Aug 2021 12:27:48 +0000</pubDate>
      <link>https://dev.to/ludder/sort-carbon-s-datatable-with-a-backend-api-1mj1</link>
      <guid>https://dev.to/ludder/sort-carbon-s-datatable-with-a-backend-api-1mj1</guid>
      <description>&lt;p&gt;&lt;a href="https://react.carbondesignsystem.com/?path=/docs/components-datatable-sorting--usage"&gt;Carbon's DataTable&lt;/a&gt; supports client-side sorting out of the box. If you need to call a web service to sort your data, it gets a little hackier. This is how I solved it:&lt;/p&gt;

&lt;p&gt;First add the &lt;code&gt;isSortable&lt;/code&gt; property to &lt;code&gt;DataTable&lt;/code&gt;:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight jsx"&gt;&lt;code&gt;&lt;span class="p"&gt;&amp;lt;&lt;/span&gt;&lt;span class="nc"&gt;DataTable&lt;/span&gt;
  &lt;span class="na"&gt;isSortable&lt;/span&gt;
  &lt;span class="si"&gt;{&lt;/span&gt;&lt;span class="p"&gt;...&lt;/span&gt;&lt;span class="nx"&gt;rest&lt;/span&gt;&lt;span class="si"&gt;}&lt;/span&gt;
&lt;span class="p"&gt;&amp;gt;&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Then add the following properties to &lt;code&gt;TableHeader&lt;/code&gt;:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight jsx"&gt;&lt;code&gt;&lt;span class="p"&gt;&amp;lt;&lt;/span&gt;&lt;span class="nc"&gt;TableHeader&lt;/span&gt;
  &lt;span class="na"&gt;onClick&lt;/span&gt;&lt;span class="p"&gt;=&lt;/span&gt;&lt;span class="si"&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="cm"&gt;/** Retrieve data from server */&lt;/span&gt;
  &lt;span class="p"&gt;})&lt;/span&gt;&lt;span class="si"&gt;}&lt;/span&gt;
  &lt;span class="na"&gt;isSortHeader&lt;/span&gt;&lt;span class="p"&gt;=&lt;/span&gt;&lt;span class="si"&gt;{&lt;/span&gt;&lt;span class="nb"&gt;Boolean&lt;/span&gt;&lt;span class="si"&gt;}&lt;/span&gt;
  &lt;span class="na"&gt;sortDirection&lt;/span&gt;&lt;span class="p"&gt;=&lt;/span&gt;&lt;span class="si"&gt;{&lt;/span&gt;&lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="s1"&gt;ASC&lt;/span&gt;&lt;span class="dl"&gt;'&lt;/span&gt; &lt;span class="o"&gt;|&lt;/span&gt; &lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="s1"&gt;DESC&lt;/span&gt;&lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="si"&gt;}&lt;/span&gt;
  &lt;span class="p"&gt;&amp;gt;&lt;/span&gt;
  &lt;span class="si"&gt;{&lt;/span&gt;&lt;span class="nx"&gt;header&lt;/span&gt;&lt;span class="si"&gt;}&lt;/span&gt;
&lt;span class="p"&gt;&amp;lt;/&lt;/span&gt;&lt;span class="nc"&gt;TableHeader&lt;/span&gt;&lt;span class="p"&gt;&amp;gt;&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Please note I use 3 undocumented features of Carbon here:&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;The &lt;code&gt;onClick&lt;/code&gt; handler is used to override the default behavior (client-side sorting) and can be used to retrieve server data.&lt;/li&gt;
&lt;li&gt;The &lt;code&gt;sortDirection&lt;/code&gt; property is used to display the correct arrow on the sorted column header.&lt;/li&gt;
&lt;li&gt;
&lt;code&gt;isSortHeader&lt;/code&gt; indicates that the current column is the one that is sorted.&lt;/li&gt;
&lt;/ol&gt;

&lt;p&gt;&lt;em&gt;As these properties are not documented they might change at any time without warning.&lt;/em&gt;&lt;/p&gt;

&lt;h2&gt;
  
  
  Bonus: Make sortable part of the Carbon headers object
&lt;/h2&gt;

&lt;p&gt;Carbon uses a header object to generate table headers, example:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight javascript"&gt;&lt;code&gt;&lt;span class="kd"&gt;const&lt;/span&gt; &lt;span class="nx"&gt;headers&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="p"&gt;[&lt;/span&gt;
  &lt;span class="p"&gt;{&lt;/span&gt;
    &lt;span class="na"&gt;key&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="s1"&gt;name&lt;/span&gt;&lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
    &lt;span class="na"&gt;header&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="s1"&gt;Name&lt;/span&gt;&lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
  &lt;span class="p"&gt;},&lt;/span&gt;
  &lt;span class="p"&gt;{&lt;/span&gt;
    &lt;span class="na"&gt;key&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="s1"&gt;status&lt;/span&gt;&lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
    &lt;span class="na"&gt;header&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="s1"&gt;Status&lt;/span&gt;&lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
  &lt;span class="p"&gt;},&lt;/span&gt;
&lt;span class="p"&gt;];&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;We can extend this object to indicate whether a certain column is sortable:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight javascript"&gt;&lt;code&gt;&lt;span class="kd"&gt;const&lt;/span&gt; &lt;span class="nx"&gt;headers&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="p"&gt;[&lt;/span&gt;
  &lt;span class="p"&gt;{&lt;/span&gt;
    &lt;span class="na"&gt;key&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="s1"&gt;name&lt;/span&gt;&lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
    &lt;span class="na"&gt;header&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="s1"&gt;Name&lt;/span&gt;&lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
  &lt;span class="p"&gt;},&lt;/span&gt;
  &lt;span class="p"&gt;{&lt;/span&gt;
    &lt;span class="na"&gt;key&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="s1"&gt;status&lt;/span&gt;&lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
    &lt;span class="na"&gt;header&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="s1"&gt;Status&lt;/span&gt;&lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
    &lt;span class="na"&gt;sort&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="s1"&gt;sortByStatus&lt;/span&gt;&lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
  &lt;span class="p"&gt;},&lt;/span&gt;
&lt;span class="p"&gt;];&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;You can now use the &lt;code&gt;sort&lt;/code&gt; key to determine if the column is sortable, and once clicked, which field the server should sort on. You'll end up with something like this:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight jsx"&gt;&lt;code&gt;&lt;span class="p"&gt;{&lt;/span&gt; &lt;span class="nx"&gt;headers&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;map&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt; &lt;span class="nx"&gt;header&lt;/span&gt; &lt;span class="o"&gt;=&amp;gt;&lt;/span&gt; &lt;span class="p"&gt;(&lt;/span&gt;
    &lt;span class="p"&gt;&amp;lt;&lt;/span&gt;&lt;span class="nc"&gt;TableHeader&lt;/span&gt;
    &lt;span class="si"&gt;{&lt;/span&gt;&lt;span class="p"&gt;...&lt;/span&gt;&lt;span class="nx"&gt;getHeaderProps&lt;/span&gt;&lt;span class="p"&gt;({&lt;/span&gt;
      &lt;span class="nx"&gt;header&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
      &lt;span class="na"&gt;isSortable&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="nb"&gt;Boolean&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nx"&gt;header&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;sort&lt;/span&gt;&lt;span class="p"&gt;),&lt;/span&gt;
    &lt;span class="p"&gt;})&lt;/span&gt;&lt;span class="si"&gt;}&lt;/span&gt;
    &lt;span class="na"&gt;onClick&lt;/span&gt;&lt;span class="p"&gt;=&lt;/span&gt;&lt;span class="si"&gt;{&lt;/span&gt;&lt;span class="nx"&gt;header&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;sort&lt;/span&gt; &lt;span class="p"&gt;?&lt;/span&gt; &lt;span class="nx"&gt;handleSort&lt;/span&gt; &lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="kc"&gt;undefined&lt;/span&gt;&lt;span class="si"&gt;}&lt;/span&gt;
    &lt;span class="na"&gt;isSortHeader&lt;/span&gt;&lt;span class="p"&gt;=&lt;/span&gt;&lt;span class="si"&gt;{&lt;/span&gt;&lt;span class="nb"&gt;Boolean&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nx"&gt;header&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;sort&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;&lt;span class="si"&gt;}&lt;/span&gt;
    &lt;span class="na"&gt;sortDirection&lt;/span&gt;&lt;span class="p"&gt;=&lt;/span&gt;&lt;span class="si"&gt;{&lt;/span&gt;&lt;span class="nx"&gt;getSortDirection&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nx"&gt;orderBy&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="nx"&gt;header&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;sort&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;&lt;span class="si"&gt;}&lt;/span&gt;
    &lt;span class="p"&gt;&amp;gt;&lt;/span&gt;
    &lt;span class="si"&gt;{&lt;/span&gt;&lt;span class="nx"&gt;header&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;header&lt;/span&gt;&lt;span class="si"&gt;}&lt;/span&gt;
  &lt;span class="p"&gt;&amp;lt;/&lt;/span&gt;&lt;span class="nc"&gt;TableHeader&lt;/span&gt;&lt;span class="p"&gt;&amp;gt;&lt;/span&gt;
&lt;span class="p"&gt;))}&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;h3&gt;
  
  
  Typescript
&lt;/h3&gt;

&lt;p&gt;The headers object now gives a TypeScript error, because the &lt;code&gt;sort&lt;/code&gt; doesn't exist. This can be solved as follows:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight typescript"&gt;&lt;code&gt;&lt;span class="k"&gt;import&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt; &lt;span class="nx"&gt;DataTableHeader&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;carbon-components-react&lt;/span&gt;&lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;

&lt;span class="k"&gt;export&lt;/span&gt; &lt;span class="kr"&gt;interface&lt;/span&gt; &lt;span class="nx"&gt;DataTableHeader&lt;/span&gt; &lt;span class="kd"&gt;extends&lt;/span&gt; &lt;span class="nx"&gt;DataTableHeader&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
  &lt;span class="nl"&gt;sort&lt;/span&gt;&lt;span class="p"&gt;?:&lt;/span&gt; &lt;span class="kr"&gt;string&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
&lt;span class="p"&gt;}&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



</description>
      <category>carbon</category>
      <category>react</category>
    </item>
    <item>
      <title>An interesting take on reduce and Object.assign</title>
      <dc:creator>Tom</dc:creator>
      <pubDate>Sun, 20 Jun 2021 20:06:10 +0000</pubDate>
      <link>https://dev.to/ludder/an-interesting-take-on-reduce-and-object-assign-1jdf</link>
      <guid>https://dev.to/ludder/an-interesting-take-on-reduce-and-object-assign-1jdf</guid>
      <description>&lt;p&gt;In this article &lt;a href="https://prateeksurana.me/blog/why-using-object-spread-with-reduce-bad-idea/"&gt;Why using object spread with reduce probably a bad idea&lt;/a&gt; I saw this strange line of code:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight javascript"&gt;&lt;code&gt;&lt;span class="nx"&gt;someArray&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;reduce&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nb"&gt;Object&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;assign&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="p"&gt;{})&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;I thought &lt;a href="https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Object/assign"&gt;&lt;code&gt;Object.assign&lt;/code&gt;&lt;/a&gt; was meant for merging objects. Why the &lt;code&gt;reduce&lt;/code&gt;? What is going on here??&lt;/p&gt;

&lt;p&gt;If I want to test some JavaScript I run &lt;code&gt;node&lt;/code&gt; in a terminal to create a playfield:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight javascript"&gt;&lt;code&gt;&lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="mi"&gt;1&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="mi"&gt;2&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="mi"&gt;3&lt;/span&gt;&lt;span class="p"&gt;].&lt;/span&gt;&lt;span class="nx"&gt;reduce&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nb"&gt;Object&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;assign&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="p"&gt;{})&lt;/span&gt;

&lt;span class="c1"&gt;// output:&lt;/span&gt;
&lt;span class="p"&gt;{&lt;/span&gt; &lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="s1"&gt;0&lt;/span&gt;&lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="mi"&gt;1&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="s1"&gt;1&lt;/span&gt;&lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="mi"&gt;2&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="s1"&gt;2&lt;/span&gt;&lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="mi"&gt;3&lt;/span&gt; &lt;span class="p"&gt;}&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Ah, good to know, might be handy sometime!&lt;/p&gt;

</description>
      <category>javascript</category>
    </item>
    <item>
      <title>How to type useRef?</title>
      <dc:creator>Tom</dc:creator>
      <pubDate>Wed, 09 Jun 2021 14:10:38 +0000</pubDate>
      <link>https://dev.to/ludder/how-to-type-useref-5hf2</link>
      <guid>https://dev.to/ludder/how-to-type-useref-5hf2</guid>
      <description>&lt;p&gt;This is more for personal reference:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight typescript"&gt;&lt;code&gt;&lt;span class="kd"&gt;const&lt;/span&gt; &lt;span class="nx"&gt;ref&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="nx"&gt;useRef&lt;/span&gt;&lt;span class="o"&gt;&amp;lt;&lt;/span&gt;&lt;span class="nx"&gt;HTMLDivElement&lt;/span&gt;&lt;span class="o"&gt;&amp;gt;&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="kc"&gt;null&lt;/span&gt;&lt;span class="p"&gt;);&lt;/span&gt;

&lt;span class="p"&gt;...&lt;/span&gt;

&lt;span class="o"&gt;&amp;lt;&lt;/span&gt;&lt;span class="nx"&gt;div&lt;/span&gt; &lt;span class="nx"&gt;ref&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;&lt;span class="p"&gt;{&lt;/span&gt;&lt;span class="nx"&gt;ref&lt;/span&gt;&lt;span class="p"&gt;}&lt;/span&gt;&lt;span class="o"&gt;&amp;gt;&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



</description>
      <category>typescript</category>
      <category>react</category>
    </item>
    <item>
      <title>YouTube Player API  for iframe embeds only works for muted content
</title>
      <dc:creator>Tom</dc:creator>
      <pubDate>Tue, 18 May 2021 14:19:00 +0000</pubDate>
      <link>https://dev.to/ludder/youtube-player-api-for-iframe-embeds-only-works-for-muted-content-2hon</link>
      <guid>https://dev.to/ludder/youtube-player-api-for-iframe-embeds-only-works-for-muted-content-2hon</guid>
      <description>&lt;p&gt;This was a hard nut to crack: &lt;br&gt;
I wanted to start a video playing when the parent container was scrolled into view. It appeared that this only works consistently for &lt;em&gt;muted&lt;/em&gt; video's.&lt;/p&gt;

&lt;p&gt;Example HTML:&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;div&lt;/span&gt; &lt;span class="na"&gt;class=&lt;/span&gt;&lt;span class="s"&gt;"video-container"&lt;/span&gt;&lt;span class="nt"&gt;&amp;gt;&lt;/span&gt;
  &lt;span class="nt"&gt;&amp;lt;iframe&lt;/span&gt;
    &lt;span class="na"&gt;id=&lt;/span&gt;&lt;span class="s"&gt;"player"&lt;/span&gt;
    &lt;span class="na"&gt;width=&lt;/span&gt;&lt;span class="s"&gt;"560"&lt;/span&gt;
    &lt;span class="na"&gt;height=&lt;/span&gt;&lt;span class="s"&gt;"315"&lt;/span&gt;
    &lt;span class="na"&gt;src=&lt;/span&gt;&lt;span class="s"&gt;"https://www.youtube.com/embed/1XPdPKKRFaE?enablejsapi=1&amp;amp;mute=1"&lt;/span&gt;
    &lt;span class="na"&gt;title=&lt;/span&gt;&lt;span class="s"&gt;"DCT introduction video"&lt;/span&gt;
    &lt;span class="na"&gt;frameborder=&lt;/span&gt;&lt;span class="s"&gt;"0"&lt;/span&gt;
    &lt;span class="na"&gt;allow=&lt;/span&gt;&lt;span class="s"&gt;"accelerometer; autoplay; clipboard-write; encrypted-media; gyroscope; picture-in-picture"&lt;/span&gt;
    &lt;span class="na"&gt;allowfullscreen&lt;/span&gt;
  &lt;span class="nt"&gt;&amp;gt;&amp;lt;/iframe&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;So the crux is here: &lt;code&gt;mute=1&lt;/code&gt;.&lt;/p&gt;

&lt;p&gt;Accompanying JS:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight javascript"&gt;&lt;code&gt;&lt;span class="kd"&gt;let&lt;/span&gt; &lt;span class="nx"&gt;player&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;

&lt;span class="c1"&gt;// Will be automatically called when https://www.youtube.com/iframe_api is loaded&lt;/span&gt;
&lt;span class="kd"&gt;function&lt;/span&gt; &lt;span class="nx"&gt;onYouTubeIframeAPIReady&lt;/span&gt;&lt;span class="p"&gt;()&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
  &lt;span class="nx"&gt;player&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="k"&gt;new&lt;/span&gt; &lt;span class="nx"&gt;YT&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;Player&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="s2"&gt;player&lt;/span&gt;&lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
    &lt;span class="na"&gt;events&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
      &lt;span class="na"&gt;onReady&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="nx"&gt;onPlayerReady&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
    &lt;span class="p"&gt;},&lt;/span&gt;
  &lt;span class="p"&gt;});&lt;/span&gt;
&lt;span class="p"&gt;}&lt;/span&gt;

&lt;span class="kd"&gt;function&lt;/span&gt; &lt;span class="nx"&gt;onPlayerReady&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nx"&gt;event&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
  &lt;span class="c1"&gt;// Start video play once in view&lt;/span&gt;
  &lt;span class="kd"&gt;let&lt;/span&gt; &lt;span class="nx"&gt;callback&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nx"&gt;entries&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="nx"&gt;observer&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;entries&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;forEach&lt;/span&gt;&lt;span class="p"&gt;((&lt;/span&gt;&lt;span class="nx"&gt;entry&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;if&lt;/span&gt; &lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nx"&gt;entry&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;isIntersecting&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
        &lt;span class="nx"&gt;player&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;playVideo&lt;/span&gt;&lt;span class="p"&gt;();&lt;/span&gt;
      &lt;span class="p"&gt;}&lt;/span&gt; &lt;span class="k"&gt;else&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
        &lt;span class="nx"&gt;player&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;pauseVideo&lt;/span&gt;&lt;span class="p"&gt;();&lt;/span&gt;
      &lt;span class="p"&gt;}&lt;/span&gt;
    &lt;span class="p"&gt;});&lt;/span&gt;
  &lt;span class="p"&gt;};&lt;/span&gt;

  &lt;span class="kd"&gt;let&lt;/span&gt; &lt;span class="nx"&gt;observer&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="k"&gt;new&lt;/span&gt; &lt;span class="nx"&gt;IntersectionObserver&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nx"&gt;callback&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="p"&gt;{});&lt;/span&gt;
  &lt;span class="kd"&gt;let&lt;/span&gt; &lt;span class="nx"&gt;target&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="nb"&gt;document&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;querySelector&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="s2"&gt;.video-container&lt;/span&gt;&lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="p"&gt;);&lt;/span&gt;
  &lt;span class="nx"&gt;observer&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;observe&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nx"&gt;target&lt;/span&gt;&lt;span class="p"&gt;);&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Notes:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;"player" is the ID of the &lt;code&gt;iframe&lt;/code&gt; used in the HTML&lt;/li&gt;
&lt;li&gt;class "video-container" is the name of the element on which the intersection observer detects if the video container is visible in the viewport or not&lt;/li&gt;
&lt;/ul&gt;

</description>
      <category>youtube</category>
      <category>iframe</category>
      <category>api</category>
      <category>javascript</category>
    </item>
    <item>
      <title>Type unknown objects</title>
      <dc:creator>Tom</dc:creator>
      <pubDate>Thu, 06 May 2021 09:28:44 +0000</pubDate>
      <link>https://dev.to/ludder/type-unknown-objects-1ih8</link>
      <guid>https://dev.to/ludder/type-unknown-objects-1ih8</guid>
      <description>&lt;p&gt;Sometimes I need to type an object, but I don't know how it will look like. Then I type it with the &lt;a href="https://www.typescriptlang.org/docs/handbook/utility-types.html#recordkeystype"&gt;Record&lt;/a&gt; utility type:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight typescript"&gt;&lt;code&gt;&lt;span class="k"&gt;export&lt;/span&gt; &lt;span class="kr"&gt;interface&lt;/span&gt; &lt;span class="nx"&gt;Label&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
    &lt;span class="nl"&gt;name&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="kr"&gt;string&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
    &lt;span class="nl"&gt;options&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="nb"&gt;Record&lt;/span&gt;&lt;span class="o"&gt;&amp;lt;&lt;/span&gt;&lt;span class="kr"&gt;string&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="kr"&gt;any&lt;/span&gt;&lt;span class="o"&gt;&amp;gt;&lt;/span&gt;&lt;span class="p"&gt;[];&lt;/span&gt;
&lt;span class="p"&gt;}&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



</description>
      <category>typescript</category>
    </item>
    <item>
      <title>How to combine Next.js, styled components and TypeScript</title>
      <dc:creator>Tom</dc:creator>
      <pubDate>Wed, 17 Feb 2021 20:35:24 +0000</pubDate>
      <link>https://dev.to/ludder/how-to-combine-next-js-styled-components-and-typescript-3aog</link>
      <guid>https://dev.to/ludder/how-to-combine-next-js-styled-components-and-typescript-3aog</guid>
      <description>&lt;p&gt;Next.js provides a handy example of how to add Styled components to your project: &lt;a href="https://github.com/vercel/next.js/tree/master/examples/with-styled-components"&gt;https://github.com/vercel/next.js/tree/master/examples/with-styled-components&lt;/a&gt;.&lt;/p&gt;

&lt;p&gt;However, it's in JavaScript, not in TypeScript. The crux is in &lt;code&gt;_document.tsx&lt;/code&gt; of which I've made a typed example in this &lt;a href="https://gist.github.com/ludder/c29efcbd0aee813a914ddaf8a3d16496"&gt;Github gist&lt;/a&gt;.&lt;/p&gt;

</description>
      <category>typescript</category>
      <category>nextjs</category>
      <category>styledcomponents</category>
    </item>
    <item>
      <title>What is webkit-line-clamp?</title>
      <dc:creator>Tom</dc:creator>
      <pubDate>Thu, 21 Jan 2021 21:13:01 +0000</pubDate>
      <link>https://dev.to/ludder/what-is-webkit-line-clamp-2pod</link>
      <guid>https://dev.to/ludder/what-is-webkit-line-clamp-2pod</guid>
      <description>&lt;p&gt;The interesting thing of reviewing someone else's code is that you discover things you didn't know. That way I learned today about &lt;code&gt;webkit-line-clamp&lt;/code&gt;. My first thought was to decline the vendor prefixed property, but I was really surprised to find out that it got &lt;a href="https://developer.mozilla.org/en-US/docs/Web/CSS/-webkit-line-clamp"&gt;&lt;em&gt;standardized&lt;/em&gt; for legacy support&lt;/a&gt;!&lt;/p&gt;

&lt;p&gt;So what does it do? &lt;code&gt;webkit-line-clamp&lt;/code&gt; is basically a &lt;strong&gt;multi-line ellipsis&lt;/strong&gt;. You can specify a certain number of lines and the last one will end in an ellipsis.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight css"&gt;&lt;code&gt;&lt;span class="nt"&gt;p&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
  &lt;span class="nl"&gt;width&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="m"&gt;300px&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
  &lt;span class="nl"&gt;display&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="n"&gt;-webkit-box&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
  &lt;span class="nl"&gt;-webkit-box-orient&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="n"&gt;vertical&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
  &lt;span class="nl"&gt;-webkit-line-clamp&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="m"&gt;3&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
  &lt;span class="nl"&gt;overflow&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="nb"&gt;hidden&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
&lt;span class="p"&gt;}&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



</description>
      <category>css</category>
    </item>
    <item>
      <title>Underline a link in 2021</title>
      <dc:creator>Tom</dc:creator>
      <pubDate>Thu, 14 Jan 2021 14:15:06 +0000</pubDate>
      <link>https://dev.to/ludder/underline-a-link-in-2021-54b9</link>
      <guid>https://dev.to/ludder/underline-a-link-in-2021-54b9</guid>
      <description>&lt;p&gt;Underlining a link doesn't involve a &lt;code&gt;border-bottom&lt;/code&gt; anymore, as I discovered on &lt;a href="https://css-tricks.com/styling-links-with-real-underlines/"&gt;CSS Tricks&lt;/a&gt;:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight css"&gt;&lt;code&gt;&lt;span class="nt"&gt;a&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
  &lt;span class="nl"&gt;text-decoration-color&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="m"&gt;#f60&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
  &lt;span class="py"&gt;text-decoration-thickness&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="m"&gt;1px&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
  &lt;span class="py"&gt;text-decoration-skip-ink&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="nb"&gt;auto&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt; &lt;span class="c"&gt;/* default */&lt;/span&gt;
  &lt;span class="py"&gt;text-underline-offset&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="m"&gt;1.5px&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
&lt;span class="p"&gt;}&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Very handy and way more flexible!&lt;/p&gt;

</description>
      <category>css</category>
    </item>
    <item>
      <title>Remove padding from storybook</title>
      <dc:creator>Tom</dc:creator>
      <pubDate>Fri, 13 Nov 2020 14:08:07 +0000</pubDate>
      <link>https://dev.to/ludder/remove-padding-from-storybook-5ad0</link>
      <guid>https://dev.to/ludder/remove-padding-from-storybook-5ad0</guid>
      <description>&lt;p&gt;After upgrading from Storybook 5 to Storybook 6 I experienced some annoying padding around all my stories.&lt;/p&gt;

&lt;p&gt;The inspector told me this was due to a padding of &lt;code&gt;1rem&lt;/code&gt; defined in the class name &lt;code&gt;sb-show-main&lt;/code&gt; on the &lt;code&gt;body&lt;/code&gt; element. I searched for how to override this class, but was totally not necessary. The solution was actually quite simple, by adding just the following snippet to &lt;code&gt;.storybook/preview.js&lt;/code&gt;:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;export const parameters = {
  layout: 'fullscreen',
};
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



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