generated from obsidianmd/obsidian-sample-plugin
-
-
Notifications
You must be signed in to change notification settings - Fork 18
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
fix: multi select was not including the values
- Loading branch information
1 parent
7425df1
commit 1885834
Showing
2 changed files
with
18 additions
and
2 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,14 @@ | ||
|
||
/** | ||
* Utility function to remove an element from an array in-place. | ||
* I'm not a fan of this kind of practices, but Obsidian is higly OOP | ||
* and relies in mutation heavily, as as Svelte (the used UI library). | ||
* This is the simplest way to make sure the data in the UI represents | ||
* the data in the app. | ||
**/ | ||
export function remove_inplace<T>(arr: Array<T>, value: T): void { | ||
const index = arr.indexOf(value); | ||
if (index > -1) { | ||
arr.splice(index, 1); | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters