title: Pipes, ramda with dynamic arguments
body: <pre><code>cons columnDefs = [
     {
       label: 'The_First_Name',
       value: getProp,
       args: ['firstName'] // different number of arguments depending on function
     },
     {
       label: 'City',
       value: getNestedProperty,
       args: ['location', 'city'] 
     }
  ]
  
  const data = [
    {
       firstName: 'Joe',
       lastName: 'Smith',
       location: {
         city: 'London'
       }
    },
     {
       firstName: 'Anna',
       lastName: 'Andersson',
       location: {
         city: 'Stockholm'
       }
    }
  ]
  
  const getProp = (object, key) =&gt; R.prop(key, object);
  
  const getNestedProperty = (obj, args) =&gt; R.path(..args, obj);
  </code></pre>
  
  <p>Ramda pipe to map the data:</p>
  
  <pre><code>const tableBuilder = R.pipe(R.map); // some ramda functions in here
  
  const rows = tableBuilder(data, columnDefs);
  </code></pre>
  
  <p>The wanted output:</p>
  
  <pre><code>rows output:
  
  [
     {
        The_First_Name: 'Joe',
        city: 'London'
     },
     {
        The_First_Name: 'Anna',
        city: 'Stockholm'
     }
  ]
  </code></pre>
  
  <p>The key of each row is the <code>label</code> property in the <code>columnDefs</code>. The value is fetched from the <code>Ramda</code> function in the <code>value</code> prop together with the arguments defined in the <code>args</code> prop.</p>
  
  <p><a href="https://plnkr.co/edit/rOGh4zkyOEF24TLaCZ4e?p=preview" rel="nofollow noreferrer">https://plnkr.co/edit/rOGh4zkyOEF24TLaCZ4e?p=preview</a></p>
  
  <p>Totally stuck. Is this even possible to do with Ramda? Or is better to do it in plain javascript?</p>