Where to put utility functions in a React-Redux application? : <p>In a React-Redux application, I've got a state like this:</p>

<pre><code>state = {
    items: [
        { id: 1, first_name: "John", last_name: "Smith", country: "us" },
        { id: 2, first_name: "Jinping", last_name: "Xi", country: "cn" },
    ]
}
</code></pre>

<p>which I render using a React component.</p>

<p>Now I need a function that gives me the "full name" of a person. So it's not just "first_name + last_name" but it depends on the country (for example, it would be "last_name + first_name" in China), so there's some relatively complex logic, which I would like to wrap in a function usable from any React component.</p>

<p>In OOP I would create a <code>Person::getFullName()</code> method that would give me this information. However the <code>state</code> object is a "dumb" one where sub-objects don't have any specialized methods.</p>

<p>So what is the recommended way to manage this in React-Redux in general? All I can think of is create a global function such as <code>user_getFullName(user)</code> which would take a user and return the full name, but that's not very elegant. Any suggestion?</p>
