Recommended nesting order when html and widget?

53 views
Skip to first unread message

Mat

unread,
Jan 23, 2021, 6:45:34 AM1/23/21
to TiddlyWiki
For a non-looping widget, like $set, is there any significant difference between the following, e.g in terms of logic or performance?

<div><$set>...</$set><div>

versus

<$set><div>...</div></$set>

Thanx

<:-)

Saq Imtiaz

unread,
Jan 23, 2021, 7:41:37 AM1/23/21
to TiddlyWiki
The former will be marginally faster when the variable assigned by <$set> changes, as the div wont need to be re-rendered.

Also consider using the <$vars> widget unless you specifically need something the <$set> widget can do which <$vars> cannot.

Mat

unread,
Jan 23, 2021, 7:53:50 AM1/23/21
to TiddlyWiki
Saq, appreciated!

<:-)

Soren Bjornstad

unread,
Jan 23, 2021, 10:02:08 AM1/23/21
to TiddlyWiki
Saq, what's the benefit of $vars over $set? I've always assumed it was just syntax, but it sounds like there might be something else?
Reply all
Reply to author
Forward
0 new messages