How to use the resolve-redux.connectViewModel function in resolve-redux

To help you get started, we’ve selected a few resolve-redux examples, based on popular ways it is used in public projects.

Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.

github reimagined / resolve / examples / shopping-list-tutorial / lesson-4 / client / containers / ShoppingList.js View on Github external
))}
      
    )
  }
}

// eslint-disable-next-line no-unused-vars
export const mapStateToOptions = (state, ownProps) => {
  return {
    viewModelName: 'shoppingList',
    aggregateIds: ['shopping-list-1']
  }
}

export default connectViewModel(mapStateToOptions)(ShoppingList)
github reimagined / resolve / examples / with-saga / client / containers / UsersInput.js View on Github external
{errors[errors.length - 1].message}
          
        )}
      
    )
  }
}

const mapStateToOptions = (_, { clientId }) => {
  return {
    viewModelName: 'error',
    aggregateIds: [clientId]
  }
}

export default connectViewModel(mapStateToOptions)(UsersInput)
github reimagined / resolve / examples / nested-list / client / containers / Todos.js View on Github external
viewModelName,
    aggregateIds: [aggregateId]
  }
}

const mapStateToProps = (state, ownProps) => {
  return {
    aggregateId: ownProps.match.params.id,
    todos: ownProps.data
  }
}

const mapDispatchToProps = (dispatch, { aggregateActions }) =>
  bindActionCreators(aggregateActions, dispatch)

export default connectViewModel(mapStateToOptions)(
  connect(
    mapStateToProps,
    mapDispatchToProps
  )(Todos)
)
github reimagined / resolve / examples / shopping-list-tutorial / lesson-6 / client / containers / ShoppingList.js View on Github external
return {
    aggregateId
  }
}

export const mapDispatchToProps = (dispatch, { aggregateActions }) =>
  bindActionCreators(
    {
      ...aggregateActions,
      replaceUrl: routerActions.replace
    },
    dispatch
  )

export default connectViewModel(mapStateToOptions)(
  connect(
    mapStateToProps,
    mapDispatchToProps
  )(ShoppingList)
)
github reimagined / resolve / examples / hacker-news / client / containers / CommentById.js View on Github external
})

export const mapDispatchToProps = (dispatch, { aggregateActions }) =>
  bindActionCreators(
    {
      commentStory: ({ aggregateId, parentId, text }) =>
        aggregateActions.commentStory(aggregateId, {
          text,
          parentId,
          commentId: uuid.v4()
        })
    },
    dispatch
  )

export default connectViewModel(mapStateToOptions)(
  connect(
    mapStateToProps,
    mapDispatchToProps
  )(CommentById)
)
github reimagined / resolve / examples / shopping-list-tutorial / lesson-5 / client / containers / ShoppingList.js View on Github external
export const mapStateToOptions = (state, ownProps) => {
  return {
    viewModelName: 'ShoppingList',
    aggregateIds: ['shopping-list-1']
  }
}

export const mapDispatchToProps = (dispatch, { aggregateActions }) =>
  bindActionCreators(
    {
      ...aggregateActions
    },
    dispatch
  )

export default connectViewModel(mapStateToOptions)(
  connect(
    null,
    mapDispatchToProps
  )(ShoppingList)
)
github reimagined / resolve / examples / shopping-list-tutorial / lesson-7 / client / containers / ShoppingList.js View on Github external
return {
    aggregateId
  }
}

export const mapDispatchToProps = (dispatch, { aggregateActions }) =>
  bindActionCreators(
    {
      ...aggregateActions,
      replaceUrl: routerActions.replace
    },
    dispatch
  )

export default connectViewModel(mapStateToOptions)(
  connect(
    mapStateToProps,
    mapDispatchToProps
  )(ShoppingList)
)
github reimagined / resolve / examples / shopping-list-advanced / native / containers / ShoppingList.js View on Github external
}

export const mapStateToProps = (state, ownProps) => {
  const aggregateId = ownProps.navigation.state.params.id

  return {
    jwt: state.jwt,
    aggregateId
  }
}

export const mapDispatchToProps = dispatch =>
  bindActionCreators(aggregateActions, dispatch)

export default requiredAuth(
  connectViewModel(mapStateToOptions)(
    connect(
      mapStateToProps,
      mapDispatchToProps
    )(ShoppingList)
  )
)
github reimagined / resolve / examples / shopping-list / client / containers / ShoppingList.js View on Github external
return {
    aggregateId
  }
}

export const mapDispatchToProps = (dispatch, { aggregateActions }) =>
  bindActionCreators(
    {
      ...aggregateActions,
      replaceUrl: routerActions.replace
    },
    dispatch
  )

export default connectViewModel(mapStateToOptions)(
  connect(
    mapStateToProps,
    mapDispatchToProps
  )(ShoppingList)
)
github reimagined / resolve / examples / hacker-news / client / containers / StoryDetails.js View on Github external
export const mapDispatchToProps = (dispatch, { aggregateActions }) =>
  bindActionCreators(
    {
      upvoteStory: aggregateActions.upvoteStory,
      unvoteStory: aggregateActions.unvoteStory,
      commentStory: ({ parentId, text }) =>
        aggregateActions.commentStory(parentId, {
          text,
          parentId,
          commentId: uuid()
        })
    },
    dispatch
  )

export default connectViewModel(mapStateToOptions)(
  connect(
    mapStateToProps,
    mapDispatchToProps
  )(StoryDetails)
)