Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
window.setTimeout(() => {
console.log('starting state', siteApp.getState())
siteApp.dispatch({
type: 'increment'
})
siteApp.dispatch({
type: 'increment'
})
// siteApp.dispatch({
// type: 'Posts.SHOW',
// data: {id: 3}
// })
siteApp.dispatch(railsActions.show({
resource: 'Posts',
id: 3
}))
siteApp.dispatch(railsActions.show({
resource: 'Posts',
id: 5,
controller: 'foo_posts'
}))
siteApp.dispatch(railsActions.show({
resource: 'Comments',
id: 15
}))
siteApp.dispatch(railsActions.index({resource: 'Photos'}))
it('should set a loading state on the singlar resource', () => {
showReducerState = showReducer(showReducerState, railsActions.show({
resource: 'User'
}))
expect(showReducerState).toEqual(
{
Posts: {
loading: false,
loadingError: undefined,
models: [{
id: 123,
loading: true,
loadingError: undefined
}]
},
User: {
loading: true,