title: ES6 Import some functions as a object
body: <p>actions.js</p>
  
  <pre><code>export const setX = () =&gt; {...}
  export const setY = () =&gt; {...}
  export const setT = () =&gt; {...}
  </code></pre>
  
  <p>somecomponent.js</p>
  
  <pre><code>import {setX, setY, setT} from 'actions'
  
  export class somecomponent extends React.Component
  {
     constructor(props,context)
     {
        super(props)
        this.state={
            X,
            Y,
            T
        }
     }
  
  
  componentWillMount()
  {
     let reduxstate = this.store.getState()
      Object.keys(this.state).forEach(n =&gt; {
        let fn = n + '-Changed';
        this[fn] = evt =&gt; {
          let update = {};
          update[n] = evt.target.value;
          this.setState(update);
          RETRIEVEDFUNCTION = ****//How to retrieve the imported actions setX,setY and setT by name****
          this.store.dispatch(RETRIEVEDFUNCTION(evt.target.value))
        }
        this.state[n] = reduxstate[n]
      });
  }
  </code></pre>
  
  <p>Will all the imported functions be in the global 'window'. I was not able to find the imported function to access them by name</p>
  
  <pre><code>allimportedfunction['set'+n ](evt.target.value)
  window['set'+n](evt.target.value)
  </code></pre>
  
  <p>or </p>
  
  <p>is there way to add only the imported function into a object</p>
  
  <pre><code>import {setX, setY, setT} as actionCreators from 'actions'
  actionCreators['set'+n ](evt.target.value)
  </code></pre>
  
  <p>import * as actionCreators from 'actions' -> This works, but I dont want to import all the functions</p>