tm-save-tiddler is consumed by the navigator widget so never reaches the root widget. You will have to add a listener for change events, then check the change list to remove ones that have 'deleted' values.
--
You received this message because you are subscribed to the Google Groups "TiddlyWikiDev" group.
To unsubscribe from this group and stop receiving emails from it, send an email to tiddlywikide...@googlegroups.com.
To post to this group, send email to tiddly...@googlegroups.com.
Visit this group at http://groups.google.com/group/tiddlywikidev.
To view this discussion on the web visit https://groups.google.com/d/msgid/tiddlywikidev/8b9bcb26-57dd-40d8-80e0-a48e5d6065d1%40googlegroups.com.
This looks like a situation where it would be useful to use the hook mechanism:The idea would be for the navigator widget to invoke a new hook "th-saving-tiddler" that gave plugins a chance to operate on a tiddler before it is saved. I'll add it to my list, but please put your hand up if anyone is willing to make a pull request.
imo plugins can't change the tiddler variable since its components are immutable.
So I think there is no need for hooks. The tiddler has to be written to the store and it needs to be overwritten anyway. eg: Which hook will win, if 2 plugins need to work with the same hook?
Also: What if the navigator widget is not involved?
IMO we should make the "tm-" and action widget mechanism more generic and usable for plugin authors. IMO the API is not very consistent atm.
-mario
That was exactly what I was looking for.Currently I'm using a startup module to subscribe to changes and operator over the changed tiddlers. Since the event listener listen for changes and change the tiddlers itself it's easy to fall to an infinite loop. I fixed it with a small cache tho control the latest modified tiddlers.I was worried about performance, because ANY change in ANY way to ANY tiddler would trigger my listener, which means 99% of unnecessary function executions. Do you think this hook would improve performance.
Regards.
--
You received this message because you are subscribed to the Google Groups "TiddlyWikiDev" group.
To unsubscribe from this group and stop receiving emails from it, send an email to tiddlywikide...@googlegroups.com.
To post to this group, send email to tiddly...@googlegroups.com.
Visit this group at http://groups.google.com/group/tiddlywikidev.
To view this discussion on the web visit https://groups.google.com/d/msgid/tiddlywikidev/fe464617-7acc-49bf-97cb-4db3bdd6a45a%40googlegroups.com.