moderator-toolbox-nxg-for-reddit / modules/shared/usernotes/archived
modules/shared/usernotes/archived¶
Functions¶
withArchived()¶
withArchived<
T>(note,archived?):T
Defined in: extension/data/modules/shared/usernotes/archived.ts:10
Returns a copy of note with its archived state replaced. Passing no archived value (or a
falsy one) clears it, dropping the key entirely rather than leaving an archived: undefined.
Type Parameters¶
T¶
T extends object
Parameters¶
note¶
T
The note to copy.
archived?¶
T["archived"]
The new archived metadata, or omit/falsy to unarchive.
Returns¶
T
A new note object with the archived state applied.