Ticket #1272 (closed enhancement: wontfix)

Opened 3 years ago

Last modified 2 years ago

allow forEachTiddler loop to be aborted

Reported by: FND Owned by: JeremyRuston
Priority: minor Milestone: 2.6.3
Component: core Version:
Severity: trivial Keywords:
Cc:

Description (last modified by FND) (diff)

For efficiency reasons, it can be useful to abort a forEachTiddler loop before it has traversed all elements.

For comparison,  jQuery.each aborts if the callback function returns false.

My immediate use case is retrieving a single tiddler from the store based on a custom field.

Change History

Changed 3 years ago by jdlrobson

reverse lookup does support custom fields in the latest (dev) version of TiddlyWiki see store.getValueTiddlers

Changed 3 years ago by FND

  • description modified (diff)

Thanks, I'd  missed that.

The original request is still valid though. Not sure whether reverseLookup would be the right place anyway, as it's designed to return multiple elements and is less generic than forEachTiddler.

Changed 2 years ago by MartinBudden

  • status changed from new to closed
  • resolution set to wontfix

The foreachTiddler loop is a simple 4-line loop which currently does not check the return value of the callback function, so any change that checks that value is potentially incompatible. The loop is simple enough that users who want early termination can write their own loop.

Note: See TracTickets for help on using tickets.