From f939d88354f649e53ef7d08ad79ef35ee14041d7 Mon Sep 17 00:00:00 2001 From: Nathan Rajlich Date: Tue, 4 Oct 2016 14:41:50 -0700 Subject: [PATCH] return a Redux thunk for the INIT action (#675) Before, Redux was throwing an error saying that a plain object was not being returned from the `init()` function which was breaking hyperterm. --- lib/actions/index.js | 14 +++++++++----- 1 file changed, 9 insertions(+), 5 deletions(-) diff --git a/lib/actions/index.js b/lib/actions/index.js index 44dfe898..e3b4dac7 100644 --- a/lib/actions/index.js +++ b/lib/actions/index.js @@ -1,9 +1,13 @@ -import {INIT} from '../constants'; import rpc from '../rpc'; +import { INIT } from '../constants'; -export function init() { - rpc.emit('init'); - return { - type: INIT +export function init () { + return (dispatch) => { + dispatch({ + type: INIT, + effect: () => { + rpc.emit('init'); + } + }); }; }