Meta
up:: ๐งช Code Diary
type:: #log/code
language:: JavaScript
program:: Obsidian, Quickadd
topics:: Coding
Quickadd API Multi Select
Summary
Put this in your capture for a multi select
Code
const suggester = this.quickAddApi.suggester;
let toSuggest = ["Up late", "Fast asleep", "Poor sleep", "Done"];
const responses = [];
let response;
while (response !== "Done") {
response = await suggester(toSuggest, toSuggest);
if (response !== "Done") {
responses.push(response);
toSuggest = toSuggest.map(s => s === response ? `โ
${s}` : s);
}
}
return responses.join(", ");
Explanation
Result
up:: ๐งช Code Diary