{"action":"created","issue":{"url":"https://api.github.com/repos/lexich/redux-api/issues/122","repository_url":"https://api.github.com/repos/lexich/redux-api","labels_url":"https://api.github.com/repos/lexich/redux-api/issues/122/labels{/name}","comments_url":"https://api.github.com/repos/lexich/redux-api/issues/122/comments","events_url":"https://api.github.com/repos/lexich/redux-api/issues/122/events","html_url":"https://github.com/lexich/redux-api/issues/122","id":198994965,"number":122,"title":"Error trying to sync()","user":{"login":"EduardoAC","id":2104706,"avatar_url":"https://avatars.githubusercontent.com/u/2104706?v=3","gravatar_id":"","url":"https://api.github.com/users/EduardoAC","html_url":"https://github.com/EduardoAC","followers_url":"https://api.github.com/users/EduardoAC/followers","following_url":"https://api.github.com/users/EduardoAC/following{/other_user}","gists_url":"https://api.github.com/users/EduardoAC/gists{/gist_id}","starred_url":"https://api.github.com/users/EduardoAC/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/EduardoAC/subscriptions","organizations_url":"https://api.github.com/users/EduardoAC/orgs","repos_url":"https://api.github.com/users/EduardoAC/repos","events_url":"https://api.github.com/users/EduardoAC/events{/privacy}","received_events_url":"https://api.github.com/users/EduardoAC/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"assignees":[],"milestone":null,"comments":2,"created_at":"2017-01-05T16:18:25Z","updated_at":"2017-01-06T07:24:11Z","closed_at":null,"body":"I started using this api because the syntax is really clear and I think it's value to have an abstraction layer on the top of my application. \r\n\r\nHowever I got a error when I try to sync my endpoint.\r\n\r\n```\r\nUncaught TypeError: e is not a function\r\n    at t.value (DeliveryProductInstancesContainer.jsx:8)\r\n    at e.notifyAll (CallbackQueue.js:76)\r\n    at n.close (ReactReconcileTransaction.js:80)\r\n    at n.closeAll (Transaction.js:206)\r\n    at n.perform (Transaction.js:153)\r\n    at l (ReactMount.js:126)\r\n    at n.perform (Transaction.js:140)\r\n    at Object.batchedUpdates (ReactDefaultBatchingStrategy.js:62)\r\n    at Object.i [as batchedUpdates] (ReactUpdates.js:97)\r\n    at Object._renderNewRootComponent (ReactMount.js:320)\r\n```\r\n\r\nImplementation of the rest\r\n```\r\n/* eslint import/no-unresolved: 0 */\r\n/* eslint import/extensions: 0 */\r\nimport reduxApi, { transformers } from 'redux-api';\r\nimport adapterFetch from 'redux-api/lib/adapters/fetch';\r\n\r\nconst headers = {\r\n  'User-Agent': 'redux-api',\r\n  Accept: 'application/json',\r\n};\r\nconst URL = 'http://localhost:8080';\r\n\r\nexport default reduxApi({\r\n  dpis: {\r\n    url: `${URL}/api/dpi`,\r\n    options: { headers },\r\n    transformer: transformers.array,\r\n  },\r\n}).use('fetch', adapterFetch(fetch));\r\n```\r\n\r\nContainer\r\n\r\n```\r\nimport React, { Component, PropTypes } from 'react';\r\nimport { connect } from 'react-redux';\r\nimport api from '../../utils/api';\r\n\r\nclass DeliveryProductInstancesContainer extends Component {\r\n  componentDidMount() {\r\n    const { dispatch } = this.props;\r\n    console.log(api.actions.dpis);\r\n    dispatch(api.actions.dpis.sync());\r\n  }\r\n  render() {\r\n    const { dpis } = this.props;\r\n    const dpiList = (dpis && dpis.data) ? dpis.data.map(item => <p>{ item.id }</p>) : null;\r\n    return (\r\n      <div>\r\n        Loading regions: { dpis && dpis.loading }\r\n        <dpiList />\r\n      </div>\r\n    );\r\n  }\r\n}\r\n\r\nDeliveryProductInstancesContainer.propTypes = {\r\n  dispatch: PropTypes.func.isRequired,\r\n  dpis: PropTypes.shape({\r\n    loading: PropTypes.bool.isRequired,\r\n    data: PropTypes.array.isRequired,\r\n  }).isRequired,\r\n};\r\nconst mapStateToProps = state => ({\r\n  dpis: state.dpis,\r\n});\r\n\r\nconst mapDispatchToProps = () => ({ });\r\n\r\nexport default connect(mapStateToProps, mapDispatchToProps)(DeliveryProductInstancesContainer);\r\n```\r\n"},"comment":{"url":"https://api.github.com/repos/lexich/redux-api/issues/comments/270847244","html_url":"https://github.com/lexich/redux-api/issues/122#issuecomment-270847244","issue_url":"https://api.github.com/repos/lexich/redux-api/issues/122","id":270847244,"user":{"login":"EduardoAC","id":2104706,"avatar_url":"https://avatars.githubusercontent.com/u/2104706?v=3","gravatar_id":"","url":"https://api.github.com/users/EduardoAC","html_url":"https://github.com/EduardoAC","followers_url":"https://api.github.com/users/EduardoAC/followers","following_url":"https://api.github.com/users/EduardoAC/following{/other_user}","gists_url":"https://api.github.com/users/EduardoAC/gists{/gist_id}","starred_url":"https://api.github.com/users/EduardoAC/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/EduardoAC/subscriptions","organizations_url":"https://api.github.com/users/EduardoAC/orgs","repos_url":"https://api.github.com/users/EduardoAC/repos","events_url":"https://api.github.com/users/EduardoAC/events{/privacy}","received_events_url":"https://api.github.com/users/EduardoAC/received_events","type":"User","site_admin":false},"created_at":"2017-01-06T07:24:11Z","updated_at":"2017-01-06T07:24:11Z","body":"As a extra information I am running the create-react-app with redux, redux-thunk and using express for the server side"}}
{"actor":{"display_login":"EduardoAC"}}