From 3f38810d64df1d151c4e73f025b2ff229b5b9c0d Mon Sep 17 00:00:00 2001 From: Emil Bay Date: Sat, 4 Jun 2016 15:48:27 +0200 Subject: [PATCH] Fix #37 `rootId` should clear if only `opts` is passed `rootId` is optional to `start`, but has lower precedence than `opts`. Currently it is not cleared when the value is passed to `opts` --- index.js | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/index.js b/index.js index ff6b089..c19c0bd 100644 --- a/index.js +++ b/index.js @@ -52,7 +52,10 @@ function choo () { // start the application // (str?, obj?) -> DOMNode function start (rootId, opts) { - if (!opts) opts = rootId + if (!opts) { + opts = rootId + rootId = null + } opts = opts || {} const name = opts.name || 'choo' const initialState = {}