<?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 Ivan Sugerman on Medium]]></title>
        <description><![CDATA[Stories by Ivan Sugerman on Medium]]></description>
        <link>https://medium.com/@jivinivan?source=rss-17f81faf8df5------2</link>
        <image>
            <url>https://cdn-images-1.medium.com/fit/c/150/150/1*SpIOx_PWBUWSVelP1zM8hA.jpeg</url>
            <title>Stories by Ivan Sugerman on Medium</title>
            <link>https://medium.com/@jivinivan?source=rss-17f81faf8df5------2</link>
        </image>
        <generator>Medium</generator>
        <lastBuildDate>Wed, 18 Nov 2026 21:33:13 GMT</lastBuildDate>
        <atom:link href="https://medium.com/@jivinivan/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[Redux Clerk: Reusable action creators and reducers for async CRUD]]></title>
            <link>https://medium.com/inside-the-embassy/redux-clerk-reusable-action-creators-and-reducers-for-async-crud-b0b6954f7056?source=rss-17f81faf8df5------2</link>
            <guid isPermaLink="false">https://medium.com/p/b0b6954f7056</guid>
            <category><![CDATA[react]]></category>
            <category><![CDATA[javascript]]></category>
            <category><![CDATA[redux]]></category>
            <category><![CDATA[open-source]]></category>
            <category><![CDATA[engineering]]></category>
            <dc:creator><![CDATA[Ivan Sugerman]]></dc:creator>
            <pubDate>Fri, 24 Mar 2017 16:18:36 GMT</pubDate>
            <atom:updated>2017-03-24T16:52:37.168Z</atom:updated>
            <content:encoded><![CDATA[<figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*XC3lVCPwUQuskCNvdrpIpQ.png" /></figure><p>A large portion of the interfaces we deal with at <a href="https://www.getambassador.com/">Ambassador</a> are dashboards and tables. This means one of our primary tasks is data management, with most logic fitting into one of four common actions: the classic create, read, update, and delete (CRUD). Since these are some of the easiest things we do as engineers, we set out to find a way to speed up the process. This enables us to focus on more difficult tasks like our core business logic. Having slogged through a seemingly endless amount of Redux boilerplate for CRUD tasks and having found limitations in other open source CRUD abstraction libraries, we eventually created Redux Clerk to solve the problem.</p><p>If you’ve ever used <a href="http://redux.js.org/">Redux</a> and <a href="https://github.com/gaearon/redux-thunk">Redux Thunk</a> you’re well aware of the repetitive nature of CRUD actions and reducers. Each CRUD operation is made up of the same set of action creators and reducer to handle each of these actions. After we built several sets of these we realized they were almost identical, with the exception of the action names and some async request configuration. <a href="https://github.com/GetAmbassador/redux-clerk">Redux Clerk</a> solves the code duplication problem by generating standard actions and reducers needed for CRUD operations.</p><h4>Before Redux Clerk</h4><pre>// User actions before Redux Clerk<br>export const createUser = (user) =&gt; { ... }<br>export const fetchUser = (userId) =&gt; { ... }<br>export const updateUser = (user) =&gt; { ... }<br>export const deleteUser = (userId) =&gt; { ... }</pre><pre>// User reducer before Redux Clerk<br>function user(state, action) {<br>  switch(action.type) {<br>    case &#39;CREATE_USER&#39;<br>      ...<br>    case &#39;CREATE_USER_SUCCESS&#39;<br>      ...<br>    case &#39;CREATE_USER_ERROR&#39;<br>      ...<br>    case &#39;FETCH_USER&#39;<br>      ...<br>    case &#39;FETCH_USER_SUCCESS&#39;<br>      ...<br>    case &#39;FETCH_USER_ERROR&#39;<br>      ...<br>    case &#39;UPDATE_USER&#39;<br>      ...<br>    case &#39;UPDATE_USER_SUCCESS&#39;<br>      ...<br>    case &#39;UPDATE_USER_ERROR&#39;<br>      ...<br>    case &#39;REMOVE_USER&#39;<br>      ...<br>    case &#39;REMOVE_USER_SUCCESS&#39;<br>      ...<br>    case &#39;REMOVE_USER_ERROR&#39;<br>      ...<br>    default <br>      return state<br>  }<br>}</pre><h4>After Redux Clerk</h4><pre>// User actions after Redux Clerk<br>import { actions } from &#39;redux-clerk&#39;<br><br>export actions({ // user actions config })</pre><pre>// User reducer after Redux Clerk<br>import { reducer } from &#39;redux-clerk&#39;<br><br>export reducer({ // user reducer config })</pre><h3>Minimal state and derived data</h3><p>As we built out more sections of our app using Redux we came across the scenario where several sections needed different lists of the same data. In one section of the app a list is displayed in a data table. In another, a detail page shows information about a single list item and other sections contain select fields or typeaheads for choosing items from a list. If we were to build out separate actions and reducers for each of these areas, we would have duplicate data in our Redux store.</p><p>Redux Clerk solves this problem by allowing sets of similar data to be created, referred to as datasets. All raw data is stored once based on a unique id. From there multiple datasets can be created which are stored as arrays of unique ids. Redux Clerk then provides a selector which re-computes the derived data from the array of ids.</p><p>This is one (of two) features that sets Redux Clerk apart from similar Redux CRUD abstraction libraries. Other libraries we’ve explored provide a reducer that only manages one set of data.</p><h4>Before Redux Clerk</h4><p>Before Redux Clerk was implemented, our store had duplicate data.</p><pre>// Campaign Table Data<br>[<br>  { uid: 123, name: &#39;Campaign 1&#39; },<br>  { uid: 234, name: &#39;Campaign 2&#39; },<br>  { uid: 354, name: &#39;Campaign 3&#39; }<br>]<br><br>// Campaign Typeahead<br>[<br>  { uid: 456, name: &#39;Campaign 4&#39; },<br>  { uid: 234, name: &#39;Campaign 2&#39; },<br>  { uid: 354, name: &#39;Campaign 3&#39; }<br>]<br><br>// Campaign Search Results<br>[<br>  { uid: 234, name: &#39;Campaign 2&#39; },<br>  { uid: 345, name: &#39;Campaign 3&#39; },<br>  { uid: 123, name: &#39;Campaign 1&#39; }<br>]<br><br>// Campaign Detail View<br>[<br>  { uid: 234, name: &#39;Campaign 2&#39; }<br>]</pre><h4>After Redux Clerk</h4><p>After Redux Clerk was implemented, our store no longer contained duplicate data.</p><pre>{<br>  // Full data objects are only stored once and never duplicated.<br>  raw: {<br>    123: { uid: 123, name: &#39;Campaign 1&#39; },<br>    234: { uid: 234, name: &#39;Campaign 2&#39; },<br>    345: { uid: 345, name: &#39;Campaign 3&#39; },<br>    345: { uid: 456, name: &#39;Campaign 4&#39; }<br>  },<br><br>  // Redux Clerk stores datasets as arrays of unique ids.<br>  instances: {<br>    campaignTable: [123, 234, 345],<br>    campaignTypeahead: [456, 234, 345],<br>    campaignSearch: [234, 345, 123],<br>    campaignDetail: [234]<br>  }<br>}</pre><h3>Async actions and wiring up a RESTful API</h3><p>Ambassador’s backend provides a RESTful API which the frontend uses for all CRUD operations. Whenever there is a CRUD action fired on the frontend, there is usually an asynchronous request that follows. Our goal was to build asynchronous functionality into Redux Clerk without making assumptions about backend interface or data structure.</p><p>To provide this functionality, Redux Clerk allows a creator, fetcher, updater and remover <a href="https://github.com/GetAmbassador/redux-clerk#action-creators">to be configured</a>. Each of these are callbacks that are fired when the related action is called. Each callback is provided all relevant data needed to make the request as well as success and error methods which are used to send the results back to Redux Clerk.</p><p>This is the second feature that sets Redux Clerk apart. Other libraries we’ve explored require more boilerplate logic to be added in order to support async actions. Redux Clerk takes care of it for you.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*okyEv-y2q26xyH2nfzWUgA.png" /><figcaption>When the fetch action is called, Redux Clerk will dispatch the start action, then call the configured fetcher. The fetcher will receive the original params object, sent to the fetch action, as well as callbacks to handle success or failure of the request. Async requests can be made inside the fetcher. Once complete, the provided success or error callbacks can be called accordingly.</figcaption></figure><h3>Handling optimistic updates</h3><p>Redux Clerk is also able to update our store optimistically. That means whenever a CRUD action is fired the store is updated instantly and the async request is made in the background. Handling optimistic updates can be tedious on a case-by-case basis. Redux Clerk makes this simple by keeping references to items pending update and automatically rolls back the changes if the asynchronous request fails.</p><h3>Concluding thoughts</h3><p><a href="https://github.com/GetAmbassador/redux-clerk">Redux Clerk</a> has helped Ambassador speed up the development process as well as reduce code and data duplication. We hope others use Redux Clerk to make the same improvements in their own apps. <a href="https://github.com/GetAmbassador/redux-clerk"><strong>Check out the project on GitHub.</strong></a> We welcome any feedback and are accepting PRs to help improve the project!</p><p>PS. Join us at the Embassy, <a href="https://www.getambassador.com/careers?utm_campaign=Jobs%2FCareers&amp;utm_source=medium&amp;utm_medium=ivan%20-%20redux%20clerk%20CRUD">we’re hiring</a>!</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=b0b6954f7056" width="1" height="1" alt=""><hr><p><a href="https://medium.com/inside-the-embassy/redux-clerk-reusable-action-creators-and-reducers-for-async-crud-b0b6954f7056">Redux Clerk: Reusable action creators and reducers for async CRUD</a> was originally published in <a href="https://medium.com/inside-the-embassy">Inside the Embassy</a> on Medium, where people are continuing the conversation by highlighting and responding to this story.</p>]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Teaching users to cook.]]></title>
            <link>https://medium.com/@jivinivan/teaching-users-to-cook-b67449a298a8?source=rss-17f81faf8df5------2</link>
            <guid isPermaLink="false">https://medium.com/p/b67449a298a8</guid>
            <dc:creator><![CDATA[Ivan Sugerman]]></dc:creator>
            <pubDate>Sun, 02 Feb 2014 20:00:07 GMT</pubDate>
            <atom:updated>2014-02-02T20:01:44.891Z</atom:updated>
            <content:encoded><![CDATA[<h4>Useful UX lessons learned from learning to cook.</h4><p>As a UX designer and developer I’m always looking for experiences in the real world that can be applied to our products to enhance the experience of our users. One of those experiences, for me, is cooking. Taking raw editable components and seeing them come together into beautiful and harmonious creations is very fulfilling. I am far from a professional chef however I have experimented enough to understand the rewarding feeling that comes from cooking something new without a recipe. This does not happen overnight. I had my time with toaster waffles and TV dinners.</p><p>Likewise, users can learn how to use our products, similar to how many of us have learned to cook. Starting with a simple goal and growing that knowledge, eventually using the products in creative and unique ways.</p><p>Below are a few of the UX lessons I have learned from cooking. The examples discuss a website builder as the product however these lessons could be applied to any scenario.</p><ol><li><strong>Start with one simple goal.<br></strong>A simple goal of satisfying your hunger can be easily achieved by popping a Stouffer’s into the microwave but we should all know that is not the healthiest route. The same goes for our users. Sure, with a few clicks we can use a website builder to generate a website, but if we stopped there every company would state their amazing expertise in “lorem ipsum dolor sit amet”.</li><li><strong>Further knowledge by providing steps for other common goals.</strong><br>Let’s face it, there comes a time when you become so sick of microwave diners and PB &amp; J you literally cannot eat them again. The logical next step is to look up a recipe and begin cooking your own meals. Continuing with the website builder example, once users have hit the magical button to generate their website they need steps to add text, images, links etc.</li><li><strong>Make the user feel a sense of fulfillment.<br></strong>When you find a great recipe and have a few people try it out they often praise your cooking abilities and call you a chef. In the back of your mind you think “All I really did was follow three black-and-white steps and put a few ingredients in a bowl”. We can give this same sense of praise to our users. Generally most webpages would contain a paragraph of text and an image or two. Congratulate them with a simple, positive message when this has been done.</li><li><strong>Encourage learning from others.<br></strong>I love to go over to friends’ and family’s houses and watch them cook. I always see different techniques, new ingredients and family secrets which grow my own knowledge and understanding of food. The same goes for websites. There is always more to know and there are tons of articles, tutorials and knowledge we can be sharing with our users.</li><li><strong>Practice makes perfect.<br></strong>The more you cook the better it gets. You find healthy shortcuts, ways to enhance the flavor and enticing presentations of your dish. Remind your users to come back and try a new feature out or, more specifically, share tips on how to make images look better on their website.</li><li><strong>Become a master.<br></strong>I am by no means a master chef, however I have gown an appreciation for certain food combinations—combinations that have allowed me to develop some of my own creations. Allow your users the ability to achieve this same creativity. Give them pathways and encouragement to get there. This could be as simple as keyboard shortcuts, APIs or even a hypothetical “blank canvas” where users can take components of your product and put them together in new and unique ways.</li></ol><p>Cooking only provides a few UX lessons from the real world. Many of these are common knowledge yet so many product experiences lack the necessary tools and feedback to make our users masters.</p><p>What other lessons can we find in the real word that would improve a users’ experience?</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=b67449a298a8" width="1" height="1" alt="">]]></content:encoded>
        </item>
    </channel>
</rss>