mirror of
https://github.com/multipleof4/sune.git
synced 2026-01-14 00:27:56 +00:00
Feat: Create state management module
This commit is contained in:
3
src/core/state.js
Normal file
3
src/core/state.js
Normal file
@@ -0,0 +1,3 @@
|
|||||||
|
import{el}from'../lib/dom.js';
|
||||||
|
export const state=window.state={messages:[],busy:false,controller:null,currentThreadId:null,abortRequested:false,attachments:[],stream:{rid:null,bubble:null,meta:null,text:'',done:false}}
|
||||||
|
export function clearChat(){el.suneHtml.dispatchEvent(new CustomEvent('sune:unmount'));state.messages=[];el.messages.innerHTML='';state.attachments=[];el.fileInput.value=''}
|
||||||
Reference in New Issue
Block a user