mirror of
https://activitypub.software/TransFem-org/Sharkey.git
synced 2024-12-29 13:59:26 +01:00
add functions to access deck column state
This commit is contained in:
parent
455ccc660e
commit
8cbc0761db
1 changed files with 11 additions and 1 deletions
|
@ -4,7 +4,7 @@
|
|||
*/
|
||||
|
||||
import { throttle } from 'throttle-debounce';
|
||||
import { markRaw } from 'vue';
|
||||
import { computed, markRaw, Ref } from 'vue';
|
||||
import { notificationTypes } from 'misskey-js';
|
||||
import type { BasicTimelineType } from '@/timelines.js';
|
||||
import { Storage } from '@/pizzax.js';
|
||||
|
@ -327,3 +327,13 @@ export async function updateColumn<TColumn>(id: Column['id'], column: Partial<TC
|
|||
saveDeck(),
|
||||
]);
|
||||
}
|
||||
|
||||
export function getColumn<TColumn extends Column>(id: Column['id']): TColumn {
|
||||
return deckStore.state.columns.find(c => c.id === id) as TColumn;
|
||||
}
|
||||
|
||||
export function getReactiveColumn<TColumn extends Column>(id: Column['id']): Ref<TColumn> {
|
||||
return computed(() => {
|
||||
return deckStore.reactiveState.columns.value.find(c => c.id === id) as TColumn;
|
||||
});
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue