1
0
mirror of https://github.com/BoostIo/Boostnote synced 2025-12-13 09:46:22 +00:00

CRUD done

This commit is contained in:
Rokt33r
2015-10-15 10:46:22 +09:00
parent 9d2b64e82b
commit 832ca3347c
8 changed files with 317 additions and 46 deletions

View File

@@ -1,7 +1,7 @@
import React from 'react'
import { createStore } from 'redux'
import { Provider } from 'react-redux'
import { updateUser, updateArticles } from './actions'
import { updateUser, refreshArticles } from './actions'
import reducer from './reducer'
import { fetchCurrentUser, fetchArticles } from 'boost/api'
import { Router, Route, IndexRoute } from 'react-router'
@@ -37,7 +37,7 @@ let finalCreateStore = compose(devTools(), persistState(window.location.href.mat
let store = finalCreateStore(reducer)
let devEl = (
<DebugPanel top right bottom>
<DevTools store={store} monitor={LogMonitor} />
<DevTools store={store} monitor={LogMonitor} visibleOnLoad={false}/>
</DebugPanel>
)
@@ -67,7 +67,7 @@ React.render((
users.forEach(user => {
fetchArticles(user.id)
.then(res => {
store.dispatch(updateArticles(user.id, res.body))
store.dispatch(refreshArticles(user.id, res.body))
})
.catch(err => {
if (err.status == null) throw err