webstudio/ui/src/features/scene_manager/model/scene_view_model.ts
2024-06-25 12:43:41 +03:00

17 lines
380 B
TypeScript

import { Result } from "../../../core/helper/result";
export class SceneViewModel {
name: string;
constructor(name: string) {
this.name = name;
}
static empty() {
return new SceneViewModel("");
}
valid = (): Result<string,SceneViewModel> => {
if (this.name.isEmpty()) {
return Result.error("name is empty");
}
return Result.ok(this);
};
}