mirror of
https://github.com/BorysLevytskyi/BitwiseCmd.git
synced 2025-12-19 03:12:25 +01:00
Make em toggle affect existing results
This commit is contained in:
@@ -14,11 +14,13 @@ export type PersistedAppData = {
|
||||
export type CommandResultView = {
|
||||
key: number,
|
||||
input: string,
|
||||
view: JSX.Element
|
||||
view: ViewFactory
|
||||
};
|
||||
|
||||
export type AppStateChangeHandler = (state: AppState) => void;
|
||||
|
||||
type ViewFactory = () => JSX.Element;
|
||||
|
||||
export default class AppState {
|
||||
|
||||
version: number = APP_VERSION;
|
||||
@@ -47,7 +49,7 @@ export default class AppState {
|
||||
this.donationClicked = persistData.donationClicked;
|
||||
}
|
||||
|
||||
addCommandResult(input : string, view : JSX.Element) {
|
||||
addCommandResult(input : string, view : ViewFactory) {
|
||||
const key = generateKey();
|
||||
this.commandResults.unshift({key, input, view});
|
||||
log.debug(`command result added: ${input}`);
|
||||
|
||||
Reference in New Issue
Block a user