From 1d38ab9f22083b9e246b295e83c8f576f5858600 Mon Sep 17 00:00:00 2001 From: Todd Kennedy Date: Sun, 19 Jun 2016 08:35:41 -0700 Subject: [PATCH] Allow for naming the rootId with no options Right now if you want to name your rootId something different, but don't pass in any options, it doesn't change the name of your rootId (see confusion in github #49. This would allow someone to use ```js const app = choo() app.start('myRootNode') ``` Rather than having to use ```js const app = choo() app.start('myRootNode', {name: 'myRootNode'}) ``` --- index.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/index.js b/index.js index 473f81e..b077dc8 100644 --- a/index.js +++ b/index.js @@ -54,7 +54,7 @@ function choo () { // start the application // (str?, obj?) -> DOMNode function start (rootId, opts) { - if (!opts) { + if (!opts && typeof rootId !== 'string') { opts = rootId rootId = null }