can't figure out shared state issue--the updated composition won't show on the composer. moving on to dnd for promptitem orders and promptitem hiding.
This commit is contained in:
@ -57,7 +57,7 @@ export function itemIsNugget(item: PromptItem): boolean {
|
||||
|
||||
export type Composition = Array<PromptItem>;
|
||||
|
||||
export const $library = atom<Library>([])
|
||||
export const $library = atom<Library>([]);
|
||||
|
||||
export function addItemToLibrary(item: LibraryItem) {
|
||||
$library.set([
|
||||
|
12
src/lib/util.tsx
Normal file
12
src/lib/util.tsx
Normal file
@ -0,0 +1,12 @@
|
||||
export function title(text: string) {
|
||||
return (!text.length) ? "" : ((text.length === 1) ? text.toUpperCase() : text[0].toUpperCase() + text.substring(1).toLowerCase());
|
||||
}
|
||||
|
||||
/**
|
||||
*
|
||||
* @param arr Array to filter
|
||||
* @param item item in the array to toggle.
|
||||
*/
|
||||
export function arrayToggle(arr : Array<any>, item : any) {
|
||||
|
||||
}
|
Reference in New Issue
Block a user