From fe859786ae36c4bf664ae140fbbace19e2a6efda Mon Sep 17 00:00:00 2001 From: Thomas Brouard Date: Tue, 1 Nov 2016 11:21:48 +0100 Subject: [PATCH] addTab and options.newTab can be a function --- index.js | 3 +++ 1 file changed, 3 insertions(+) diff --git a/index.js b/index.js index ecfbcc2..8460bf0 100644 --- a/index.js +++ b/index.js @@ -57,6 +57,9 @@ class TabGroup extends EventEmitter { } addTab (args = this.options.newTab) { + if (typeof args === "function") { + args = args(this); + } let id = this.newTabId; this.newTabId++; let tab = new Tab(this, id, args);