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:
@@ -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 = {}
|
||||||
|
|||||||
Reference in New Issue
Block a user