From f17a78ad52ae6b5519b5cdf6d15220a116f333c1 Mon Sep 17 00:00:00 2001 From: kevguy Date: Tue, 18 Apr 2017 18:43:59 +0800 Subject: [PATCH 1/2] fix: fix webpack config and update logger --- src/message-board.js | 8 ++++---- webpack.config.js | 4 ++-- 2 files changed, 6 insertions(+), 6 deletions(-) diff --git a/src/message-board.js b/src/message-board.js index b256c23..dee3cde 100644 --- a/src/message-board.js +++ b/src/message-board.js @@ -1,6 +1,6 @@ import { createStore, combineReducers, applyMiddleware } from 'redux' import { get } from './http'; -import logger from 'redux-logger'; +import { createLogger } from 'redux-logger' export const ONLINE = `ONLINE`; export const AWAY = `AWAY`; @@ -99,7 +99,7 @@ const combinedReducer = combineReducers({ const store = createStore( combinedReducer, - applyMiddleware(logger()) + applyMiddleware(createLogger()) ); const render = ()=>{ @@ -107,7 +107,7 @@ const render = ()=>{ document.getElementById("messages").innerHTML = messages .sort((a,b)=>b.date - a.date) .map(message=>(` -
+
${message.postedBy} : ${message.content}
` )).join(""); @@ -130,4 +130,4 @@ document.forms.selectStatus.status.addEventListener("change",(e)=>{ render(); -store.subscribe(render) \ No newline at end of file +store.subscribe(render) diff --git a/webpack.config.js b/webpack.config.js index f9d279e..b036639 100644 --- a/webpack.config.js +++ b/webpack.config.js @@ -26,9 +26,9 @@ module.exports = { }, output: { path: path.resolve(__dirname, "public"), - publicPath: "/assets/", + publicPath: "/public/assets/", filename: "[name].bundle.js" }, devServer: { inline: true }, devtool: 'source-map', -} \ No newline at end of file +} From 76fcf827c76ae209d7c3e43c73432ead9e2efdde Mon Sep 17 00:00:00 2001 From: kevguy Date: Fri, 21 Apr 2017 12:43:34 +0800 Subject: [PATCH 2/2] update Redux-Logger --- webpack.config.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/webpack.config.js b/webpack.config.js index b036639..0ae788b 100644 --- a/webpack.config.js +++ b/webpack.config.js @@ -26,7 +26,7 @@ module.exports = { }, output: { path: path.resolve(__dirname, "public"), - publicPath: "/public/assets/", + publicPath: "/assets/", filename: "[name].bundle.js" }, devServer: { inline: true },