You cannot select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

20 lines
400 B
TypeScript

import { Reducer } from "preact/hooks";
import { ViewState } from "../App/state.ts";
export type State = null;
export type Action = { kind: "editNewSchema" } | { kind: "hello" };
export const reduce = (state: ViewState, action: Action): ViewState => {
if (action.kind == "hello") {
return state;
}
return {
kind: "SchemaEditor",
state: {
fields: [],
name: "New schema",
},
};
};