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`
This commit is contained in:
Emil Bay
2016-06-04 15:48:27 +02:00
parent a1be33269d
commit 3f38810d64
+4 -1
View File
@@ -52,7 +52,10 @@ function choo () {
// start the application // start the application
// (str?, obj?) -> DOMNode // (str?, obj?) -> DOMNode
function start (rootId, opts) { function start (rootId, opts) {
if (!opts) opts = rootId if (!opts) {
opts = rootId
rootId = null
}
opts = opts || {} opts = opts || {}
const name = opts.name || 'choo' const name = opts.name || 'choo'
const initialState = {} const initialState = {}