togglePin method

bool togglePin(
  1. PeekId id
)

Pins or unpins the entry with id; returns whether it is pinned afterwards.

Implementation

bool togglePin(PeekId id) {
  if (store.find(id)?.isPinned ?? false) {
    unpin(id);
    return false;
  }
  return pin(id);
}