Skip to content

Commit

Permalink
chore: with mixins +3
Browse files Browse the repository at this point in the history
  • Loading branch information
seankwarren committed Feb 8, 2024
1 parent 777600e commit 565e2db
Showing 1 changed file with 4 additions and 3 deletions.
7 changes: 4 additions & 3 deletions src/flavor.ts
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@ import { Template as AdeTemplate } from "./template";
import { NamedTemplate } from "./types";
import { Constructor } from "@exabyte-io/code.js/dist/context";
import { AnyObject } from "@exabyte-io/code.js/dist/entity/in_memory";
import { ExecutionUnitInputItemSchemaForPhysicsBasedSimulationEngines, TemplateSchema1 } from "@exabyte-io/code.js/dist/types";

const Base = RuntimeItemsMixin(NamedDefaultableHashedInMemoryEntity);
type FlavorBaseEntity = InstanceType<typeof Base>;
Expand All @@ -18,13 +19,13 @@ export function FlavorMixin<
return class Flavor extends superclass {
static Template = Template;

get input(): NamedTemplate[] {
return this.prop<NamedTemplate[]>("input", []);
get input() {
return this.prop<(ExecutionUnitInputItemSchemaForPhysicsBasedSimulationEngines & {templateName?: string})[]>("input", []);
}

get inputAsTemplates() {
return this.input.map((input) => {
const templateName = 'name' in input ? input.name : input.templateName;
const templateName = 'templateName' in input && input.templateName ? input.templateName : input.name;
const template = Flavor.Template.fromFlavor(
this.prop("applicationName"),
this.prop("executableName"),
Expand Down

0 comments on commit 565e2db

Please sign in to comment.