<?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 Alexandra Espichán Linares on Medium]]></title>
        <description><![CDATA[Stories by Alexandra Espichán Linares on Medium]]></description>
        <link>https://medium.com/@aespichan?source=rss-b864836e0ab3------2</link>
        <image>
            <url>https://cdn-images-1.medium.com/fit/c/150/150/2*iZB5eb2XFK8sXCI3PM5dRw.jpeg</url>
            <title>Stories by Alexandra Espichán Linares on Medium</title>
            <link>https://medium.com/@aespichan?source=rss-b864836e0ab3------2</link>
        </image>
        <generator>Medium</generator>
        <lastBuildDate>Fri, 20 Nov 2026 06:16:03 GMT</lastBuildDate>
        <atom:link href="https://medium.com/@aespichan/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[How to mutate partial keys in SWR?]]></title>
            <link>https://aespichan.medium.com/how-to-mutate-partial-keys-in-swr-117aee9629a6?source=rss-b864836e0ab3------2</link>
            <guid isPermaLink="false">https://medium.com/p/117aee9629a6</guid>
            <category><![CDATA[react]]></category>
            <category><![CDATA[mutate]]></category>
            <category><![CDATA[swr]]></category>
            <category><![CDATA[partial]]></category>
            <dc:creator><![CDATA[Alexandra Espichán Linares]]></dc:creator>
            <pubDate>Fri, 06 Nov 2020 06:16:08 GMT</pubDate>
            <atom:updated>2020-11-06T06:17:18.055Z</atom:updated>
            <content:encoded><![CDATA[<h4>Here a simple function to mutate SWR keys from a partial key will be shown.</h4><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*4IWtIGMgjrJVsQeX" /><figcaption>Photo by <a href="https://unsplash.com/@baileyzindel?utm_source=medium&amp;utm_medium=referral">Bailey Zindel</a> on <a href="https://unsplash.com/?utm_source=medium&amp;utm_medium=referral">Unsplash</a></figcaption></figure><h4>The problem</h4><p>Last time, I had 2 React components that were inside the same page and each one made use of the <em>useSWR</em> hook with a very long key (which included the use of many parameters).</p><p>Here is a diagram better explaining the situation:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*CTU8a32ZS-mZPBbdL4EvKQ.png" /></figure><p>In <em>Component A</em> we had details of <em>resource one</em> and a form that creates a new object of type <em>resource two</em>. So, when the form is submitted, <em>Component B</em> should be updated to show the new object of type <em>resource two</em> that was created.</p><p>In SWR there exists a <a href="https://swr.vercel.app/docs/mutation">mutate</a> function to which you pass the key, an optional data and a boolean value that indicates if the api should be revalidated (with a default value of <em>true</em>).</p><p>However, this function needs the entire key and if you want to mutate the <em>/api/resource-two</em> from <em>Component A</em> it would be difficult as the key is long and depends on a state that exists inside <em>Component B</em> (<em>sortBy</em>).</p><h4>The solution</h4><p>So, I have created a simple function that allows to mutate a partial key. Here is the implementation:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/461/1*S75tUMcUQwnjnKRFD_EI-g.png" /></figure><p>This function receives a partial key which is expected to be a string, then it gets all the keys from the SWR cache, filters all the keys that contains the partial key, and mutates all the filtered keys.</p><p>With this function you can do the following:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/442/1*SZUm4C8MHC__YwqfvxLTkw.png" /></figure><p>In this way, you can mutate the data in <em>Component B</em> from <em>Component A </em>without the need of passing the whole key and without worrying about the <em>sortBy</em> variable.</p><p>This also works for keys that are arrays. For instance, if we have something like:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/759/1*T8fj2OHUPESrDw1QrFn5mw.png" /></figure><p>We can mutate both <em>data1</em> and <em>data2</em> using:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/442/1*qLMZCn04dKZMR7jII-g5Wg.png" /></figure><p>Thank you for reading! Feel free to use and improve this, any feedback is appreciated 😁</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=117aee9629a6" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Statement of purpose for acceptance to Akademy.ai #WeAllFitWomenScholarship 2019]]></title>
            <link>https://aespichan.medium.com/statement-of-purpose-for-acceptance-to-akademy-ai-weallfitwomenscholarship-2019-f047353cae8a?source=rss-b864836e0ab3------2</link>
            <guid isPermaLink="false">https://medium.com/p/f047353cae8a</guid>
            <category><![CDATA[data-science]]></category>
            <category><![CDATA[artificial-intelligence]]></category>
            <category><![CDATA[akademy]]></category>
            <category><![CDATA[weallfitinai]]></category>
            <category><![CDATA[weallfitwomenscholarship]]></category>
            <dc:creator><![CDATA[Alexandra Espichán Linares]]></dc:creator>
            <pubDate>Sun, 15 Sep 2019 22:53:58 GMT</pubDate>
            <atom:updated>2020-11-06T05:46:13.143Z</atom:updated>
            <content:encoded><![CDATA[<p>Hi everyone! this is my statement of purpose for my application to the <strong>#WeAllFitWomenScholarship</strong> 2019, hosted by Akademy.ai</p><p>Claps, shares and feedback is appreciated!</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/525/1*GmWp-MY7DBhUEHBgy53fQw@2x.jpeg" /><figcaption>Monalisa restyled by Picasso, Van Gogh and Monet. One of my favorite AI applications: style transfer.</figcaption></figure><p>My name is Alexandra, I’m a 23 year old Peruvian woman passionate about artificial intelligence issues. I studied Informatics Engineering and I’m currently working as a research assistant at the Artificial Intelligence Group of my university. I will tell you my experience in the path of AI.</p><h4>The beginnings</h4><p>My interest in AI began when I took a course at the university that included some Machine Learning topics. Then I started researching and learning more on my own.</p><h4>My undergraduate thesis</h4><p>For my undergraduate thesis I chose to make a Natural Language Processing application. I worked on a language identifier for 49 Peruvian native languages. Then I wrote a paper about this work and presented it at the SIMBig 2017 conference in Lima, Peru. This project was part of the AI Group.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/576/1*IPfxGwUnJH7BaEv33y_GPQ@2x.jpeg" /><figcaption>My advisor and me at the SIMBig conference</figcaption></figure><blockquote>The original paper can be found at: <a href="http://ceur-ws.org/Vol-2029/paper3.pdf">http://ceur-ws.org/Vol-2029/paper3.pdf</a></blockquote><blockquote>And the extended version of the paper can be found at: <a href="https://rd.springer.com/chapter/10.1007/978-3-319-90596-9_7">https://rd.springer.com/chapter/10.1007/978-3-319-90596-9_7</a></blockquote><h4>Bioinformatics</h4><p>Later, I worked on a bioinformatics project at the AI Group. I have always liked topics related to biology and genetics, in fact I wanted to study biology, so doing a project in this field was very satisfying and interesting for me. I developed a novel ensemble method for high-dimensional genomic data classification. Then I wrote a paper about this work and presented it at the IEEE BIBM 2018 conference in Madrid, Spain.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*VGZ-NS4bOJ4OTfcLJEnXow@2x.jpeg" /><figcaption>My certification for presenting at the IEEE BIBM conference</figcaption></figure><blockquote>The paper can be found at: <a href="https://ieeexplore.ieee.org/document/8621386">https://ieeexplore.ieee.org/document/8621386</a></blockquote><h4>Women in Data Science (WiDS)</h4><p>On the other hand, I also like to give talks to share my experiences with those people who are also interested in AI. I gave a talk at the WiDS conference in Peru this 2019.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/502/1*_PaK9904oviFZg9UBDzJyg@2x.jpeg" /></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/972/1*vSEgJb1j2G_cMq1mFdtCYQ@2x.jpeg" /></figure><h4>Workshop on Artificial Intelligence and Machine Learning Applications 2019 at PUCP</h4><p>I also gave a talk at a workshop of my university. I focused on AI applications for the insurance industry as I worked as a Data Scientist in Rimac, the most important insurance company of Peru.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/795/1*LwaY3GoU-YrQAMyTMS5YcQ@2x.jpeg" /></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/840/1*HS8_ZGISeTl8UWZ_-Um1Wg@2x.jpeg" /></figure><h4>Re-work deep learning summit</h4><p>When I worked as a Data Scientist at Rimac, I participated in a challenge to apply AI to certain problems of the Breca Group (business conglomerate to which Rimac belongs). My team developed a virtual voice assistant to answer questions about the performance of companies of the Breca Group. We were awarded with a travel to an important conference held in Boston: Deep Learning Summit.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*XgGlnYOaES1W5bPajXlozw@2x.jpeg" /></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/540/1*GHr7xzBSlG9DsV77ytQwaA@2x.jpeg" /></figure><h4>Present</h4><p>I am currently working in some projects at the AI Group that involves financial and social issues. I also have some pending talks to give soon within my country, which makes me happy. And I always want to learn more things, so I would really like to participate in the AI Engineering Bootcamp!</p><p>Details of the program can be found at: <a href="http://www.akademy.ai/">www.akademy.ai</a></p><p><strong>#WeAllFit</strong> <strong>#WeAllFitWomenScholarship</strong></p><p>Follow me on Twitter: <a href="https://twitter.com/aeslinares01">@aeslinares01</a></p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=f047353cae8a" width="1" height="1" alt="">]]></content:encoded>
        </item>
    </channel>
</rss>