Added to TW-Scripts https://kookma.github.io/TW-Scripts/#When%20to%20Use%20Temp%20and%20When%20to%20Use%20State%20Tiddlers
Hi Eric! Quite useful information and WISH to have such explanation in tiddlywiki.com --Mohammad On Thursday, January 9, 2020 at 8:00:58 AM UTC+3:30, Eric Shulman wrote: > > On Wednesday, January 8, 2020 at 7:57:42 PM UTC-8, Mohammad wrote: >> >> Tiddlywiki stores global variables in tiddler fields. >> For example all state tiddlers in widgets like reveal, checkbox, >> edit-text, ... >> Considering both single file wiki and Node.js wiki what are your >> recommendation in using >> >> - $:/temp/mytiddlers >> - $:/state/mytiddlers >> >> Both $:/temp and $:/state are ignored when determining if the document is > "dirty" (see $:/core/SaverFilter)... and by default both are saved when you > save the file (except for $:/state/popup, which are NOT saved... see > $:/core/save/all) > > However, conceptually, $:/temp tiddlers should be "throw-away"... able to > be discarded when not actually in use, while $:/state tiddlers should > reasonably be expected to persist across sessions. > > To enforce this difference, I routinely create a tiddler, tagged with > $:/tags/Macro, containing: > \define publishFilter() -[prefix[$:/temp]] > > This variable is automatically included by the $:/core/save/all filter. > The effect is that $:/temp tiddlers are NOT saved when you save the file > and are, in effect, automatically discarded at the end of the session. > > Thus, if I want a reveal state to always revert to closed on startup, I > will use a $:/temp tiddler, but if I want the reveal state to persist > across sessions, I will use a $:/state tiddler > > -e > > > -- You received this message because you are subscribed to the Google Groups "TiddlyWiki" group. To unsubscribe from this group and stop receiving emails from it, send an email to [email protected]. To view this discussion on the web visit https://groups.google.com/d/msgid/tiddlywiki/40d52403-a651-43d0-a60b-e53735299a90%40googlegroups.com.

