Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
export const mapStateToOptions = () => ({
readModelName: 'ShoppingLists',
resolverName: 'all',
resolverArgs: {}
})
// eslint-disable-next-line no-unused-vars
export const mapStateToProps = (state, ownProps) => ({
lists: state.optimisticShoppingLists || []
})
export const mapDispatchToProps = (dispatch, { aggregateActions }) =>
bindActionCreators(aggregateActions, dispatch)
export default connectReadModel(mapStateToOptions)(
connect(
mapStateToProps,
mapDispatchToProps
)(MyLists)
)
))}
)
}
}
// eslint-disable-next-line no-unused-vars
export const mapStateToOptions = (state, ownProps) => {
return {
viewModelName: 'shoppingList',
aggregateIds: ['shopping-list-1']
}
}
export default connectViewModel(mapStateToOptions)(ShoppingList)
const socketHandler = socket => {
if (isOpenBrowser) {
socket.emit('event', JSON.stringify(actions.hotModuleReplacement()))
}
const emitter = event => socket.emit('event', JSON.stringify(event))
let unsubscribePromise = eventStore.subscribeOnBus(
{ types: [], ids: [] },
emitter
)
const unsubscribe = () => {
if (unsubscribePromise) {
unsubscribePromise.then(unsubscribeCallback => unsubscribeCallback())
unsubscribePromise = null
}
}
socket.on('setSubscription', eventsDescription => {
socket.on('initialState', state => emit(actions.mergeState('cards', state)));
socket.on('event', event => emit(event));
}
export const mapStateToOptions = () => ({
readModelName: 'ShoppingLists',
resolverName: 'all',
resolverArgs: {}
})
export const mapStateToProps = state => ({
lists: state.optimisticShoppingLists || []
})
export const mapDispatchToProps = dispatch =>
bindActionCreators(aggregateActions, dispatch)
export default connectReadModel(mapStateToOptions)(
connect(
mapStateToProps,
mapDispatchToProps
)(MyLists)
)
resolverName,
resolverArgs: {
itemsOnPage,
pageNumber
}
})
const mapStateToProps = (state, { data }) => ({
comments: data ? data.comments : undefined,
paginationDone: data ? data.paginationDone : undefined
})
export const mapDispatchToProps = (dispatch, { aggregateActions }) =>
bindActionCreators(aggregateActions, dispatch)
export default connectReadModel(mapStateToOptions)(
connect(
mapStateToProps,
mapDispatchToProps
)(CommentsTreeRenderless)
)
export const mapStateToOptions = () => ({
readModelName: 'ShoppingLists',
resolverName: 'all',
resolverArgs: {}
})
export const mapStateToProps = state => ({
lists: state.optimisticShoppingLists
})
export const mapDispatchToProps = dispatch =>
bindActionCreators(aggregateActions, dispatch)
export default requiredAuth(
connectReadModel(mapStateToOptions)(
connect(
mapStateToProps,
mapDispatchToProps
)(MyLists)
)
)
export const mapStateToProps = state => ({
lists: state.optimisticShoppingLists
})
export const mapDispatchToProps = dispatch =>
bindActionCreators(
{
...aggregateActions,
...refreshActions
},
dispatch
)
export default requiredAuth(
connectReadModel(mapStateToOptions)(
connect(
mapStateToProps,
mapDispatchToProps
)(MyLists)
)
)
}
const mapStateToOptions = () => {
return {
readModelName: 'default',
resolverName: 'default',
resolverArgs: {}
}
}
const mapStateToProps = ({ user }) => ({ user })
const mapDispatchToProps = (dispatch, { aggregateActions }) =>
bindActionCreators(aggregateActions, dispatch)
export default connectReadModel(mapStateToOptions)(
connect(
mapStateToProps,
mapDispatchToProps
)(App)
)
}
}
export const mapStateToOptions = state => ({
readModelName: 'ShoppingLists',
resolverName: 'user',
resolverArgs: {
id: state.jwt.id
}
})
export const mapDispatchToProps = dispatch =>
bindActionCreators(aggregateActions, dispatch)
export default requiredAuth(
connectReadModel(mapStateToOptions)(
connect(
null,
mapDispatchToProps
)(Settings)
)
)