Exporting entities in index.js does not work
arvinsim opened this issue · comments
I have this code
// duck/index.js
import reducer from './reducer'
import * as duckTypes from './types'
import * as duckActions from './actions'
import * as duckSelectors from './selectors'
export {
duckTypes,
duckActions,
duckSelectors
}
export default reducer
I tried importing an action but I get an error
// This does not import getFoobar
import { getFoobar } from '../duck'
Any idea why this is the case?
following this pattern you create a named export for the whole actions
object. so it would be
import { actions } from '../duck';
actions.getFoobar();