mobx#override TypeScript Examples

The following examples show how to use mobx#override. You can vote up the ones you like or vote down the ones you don't like, and go to the original project or source file by following the links above each example. You may check out the related API usage on the sidebar.
Example #1
Source File: DSLDiagram_ObserverHelper.ts    From legend-studio with Apache License 2.0 6 votes vote down vote up
observe_Diagram = skipObserved((metamodel: Diagram): Diagram => {
  observe_Abstract_PackageableElement(metamodel);

  makeObservable<Diagram, '_elementHashCode'>(metamodel, {
    classViews: observable,
    associationViews: observable,
    generalizationViews: observable,
    propertyViews: observable,
    _elementHashCode: override,
  });

  metamodel.classViews.forEach(observe_ClassView);
  metamodel.associationViews.forEach(observe_AssociationView);
  metamodel.generalizationViews.forEach(observe_GeneralizationView);
  metamodel.propertyViews.forEach(observe_PropertyView);

  return metamodel;
})
Example #2
Source File: ClassEditorState.ts    From legend-studio with Apache License 2.0 6 votes vote down vote up
constructor(editorStore: EditorStore, element: PackageableElement) {
    super(editorStore, element);

    makeObservable(this, {
      classState: observable,
      selectedProperty: observable,
      class: computed,
      hasCompilationError: computed,
      reprocess: override,
      setSelectedProperty: action,
    });

    this.classState = new ClassState(editorStore, this.class);
  }
Example #3
Source File: StoreRelational_ObserverHelper.ts    From legend-studio with Apache License 2.0 6 votes vote down vote up
observe_Database = skipObservedWithContext(
  (metamodel: Database, context): Database => {
    observe_Abstract_PackageableElement(metamodel);

    makeObservable<Database, '_elementHashCode'>(metamodel, {
      schemas: observable,
      joins: observable,
      filters: observable,
      _elementHashCode: override,
    });

    metamodel.schemas.forEach((schema) => observe_Schema(schema, context));
    metamodel.joins.forEach(observe_Join);
    metamodel.filters.forEach(observe_Filter);

    return metamodel;
  },
)
Example #4
Source File: StoreFlatData_ObserverHelper.ts    From legend-studio with Apache License 2.0 6 votes vote down vote up
observe_FlatData = skipObserved(
  (metamodel: FlatData): FlatData => {
    observe_Abstract_PackageableElement(metamodel);

    makeObservable<FlatData, '_elementHashCode'>(metamodel, {
      sections: observable,
      _elementHashCode: override,
    });

    metamodel.sections.forEach(observe_FlatDataSection);

    return metamodel;
  },
)
Example #5
Source File: DomainObserverHelper.ts    From legend-studio with Apache License 2.0 6 votes vote down vote up
observe_ConcreteFunctionDefinition = skipObserved(
  (metamodel: ConcreteFunctionDefinition): ConcreteFunctionDefinition => {
    observe_Abstract_PackageableElement(metamodel);

    makeObservable<ConcreteFunctionDefinition, '_elementHashCode'>(metamodel, {
      returnMultiplicity: observable,
      parameters: observable.shallow, // only observe the list structure, each object itself is not observed
      body: observable.ref, // only observe the reference, the object itself is not observed
      stereotypes: observable,
      taggedValues: observable,
      _elementHashCode: override,
    });

    metamodel.parameters.forEach(observe_RawVariableExpression);
    observe_PackageableElementReference(metamodel.returnType);
    observe_Multiplicity(metamodel.returnMultiplicity);
    metamodel.stereotypes.forEach(observe_StereotypeReference);
    metamodel.taggedValues.forEach(observe_TaggedValue);

    return metamodel;
  },
)
Example #6
Source File: DomainObserverHelper.ts    From legend-studio with Apache License 2.0 6 votes vote down vote up
observe_Association = skipObserved(
  (metamodel: Association): Association => {
    observe_Abstract_PackageableElement(metamodel);

    makeObservable<Association, '_elementHashCode'>(metamodel, {
      properties: observable,
      stereotypes: observable,
      taggedValues: observable,
      derivedProperties: observable,
      _elementHashCode: override,
    });

    metamodel.properties.forEach(observe_Property);
    metamodel.derivedProperties.forEach(observe_DerivedProperty);
    metamodel.stereotypes.forEach(observe_StereotypeReference);
    metamodel.taggedValues.forEach(observe_TaggedValue);

    return metamodel;
  },
)
Example #7
Source File: DomainObserverHelper.ts    From legend-studio with Apache License 2.0 6 votes vote down vote up
observe_Class = skipObserved((metamodel: Class): Class => {
  observe_Abstract_PackageableElement(metamodel);

  makeObservable<Class, '_elementHashCode'>(metamodel, {
    _subclasses: observable,
    properties: observable,
    propertiesFromAssociations: observable,
    derivedProperties: observable,
    generalizations: observable,
    constraints: observable,
    stereotypes: observable,
    taggedValues: observable,
    dispose: override,
    _elementHashCode: override,
  });

  metamodel.properties.forEach(observe_Property);
  metamodel.propertiesFromAssociations.forEach(observe_Property);
  metamodel.derivedProperties.forEach(observe_DerivedProperty);
  metamodel.generalizations.forEach(observe_GenericTypeReference);
  metamodel.constraints.forEach(observe_Constraint);
  metamodel.stereotypes.forEach(observe_StereotypeReference);
  metamodel.taggedValues.forEach(observe_TaggedValue);

  return metamodel;
})
Example #8
Source File: DomainObserverHelper.ts    From legend-studio with Apache License 2.0 6 votes vote down vote up
observe_Measure = skipObserved((metamodel: Measure): Measure => {
  observe_Abstract_PackageableElement(metamodel);

  makeObservable<Measure, '_elementHashCode'>(metamodel, {
    canonicalUnit: observable,
    nonCanonicalUnits: observable,
    _elementHashCode: override,
  });

  if (metamodel.canonicalUnit) {
    observe_Unit(metamodel.canonicalUnit);
  }
  metamodel.nonCanonicalUnits.forEach(observe_Unit);

  return metamodel;
})
Example #9
Source File: DomainObserverHelper.ts    From legend-studio with Apache License 2.0 6 votes vote down vote up
observe_Unit = skipObserved((metamodel: Unit): Unit => {
  makeObservable(metamodel, {
    measure: observable,
    conversionFunction: observable,
    hashCode: override,
  });

  if (metamodel.conversionFunction) {
    observe_RawLambda(metamodel.conversionFunction);
  }

  return metamodel;
})
Example #10
Source File: DomainObserverHelper.ts    From legend-studio with Apache License 2.0 6 votes vote down vote up
observe_Enumeration = skipObserved(
  (metamodel: Enumeration): Enumeration => {
    observe_Abstract_PackageableElement(metamodel);

    makeObservable<Enumeration, '_elementHashCode'>(metamodel, {
      values: observable,
      stereotypes: observable,
      taggedValues: observable,
      _elementHashCode: override,
    });

    metamodel.values.forEach(observe_Enum);
    metamodel.stereotypes.forEach(observe_StereotypeReference);
    metamodel.taggedValues.forEach(observe_TaggedValue);

    return metamodel;
  },
)
Example #11
Source File: DomainObserverHelper.ts    From legend-studio with Apache License 2.0 6 votes vote down vote up
observe_Profile = skipObserved((metamodel: Profile): Profile => {
  observe_Abstract_PackageableElement(metamodel);

  makeObservable<Profile, '_elementHashCode'>(metamodel, {
    stereotypes: observable,
    tags: observable,
    _elementHashCode: override,
  });

  metamodel.stereotypes.forEach(observe_Stereotype);
  metamodel.tags.forEach(observe_Tag);

  return metamodel;
})
Example #12
Source File: DomainObserverHelper.ts    From legend-studio with Apache License 2.0 6 votes vote down vote up
observe_SectionIndex = skipObserved(
  (metamodel: SectionIndex): SectionIndex => {
    observe_Abstract_PackageableElement(metamodel);

    makeObservable<SectionIndex, '_elementHashCode'>(metamodel, {
      sections: observable,
      _elementHashCode: override,
    });

    metamodel.sections.forEach(observe_Section);

    return metamodel;
  },
)
Example #13
Source File: DSLService_ObserverHelper.ts    From legend-studio with Apache License 2.0 6 votes vote down vote up
observe_Service = skipObservedWithContext(
  (metamodel: Service, context): Service => {
    observe_Abstract_PackageableElement(metamodel);

    makeObservable<Service, '_elementHashCode'>(metamodel, {
      pattern: observable,
      owners: observable,
      documentation: observable,
      autoActivateUpdates: observable,
      execution: observable,
      test: observable,
      tests: observable,
      patternParameters: computed,
      _elementHashCode: override,
    });

    metamodel.stereotypes.forEach(observe_StereotypeReference);
    metamodel.taggedValues.forEach(observe_TaggedValue);
    observe_ServiceExecution(metamodel.execution, context);
    if (metamodel.test) {
      observe_ServiceTest_Legacy(metamodel.test);
    }
    metamodel.tests.forEach((m) => observe_ServiceTestSuite(m, context));
    return metamodel;
  },
)
Example #14
Source File: DSLMapping_ObserverHelper.ts    From legend-studio with Apache License 2.0 6 votes vote down vote up
observe_PackageableRuntime = skipObservedWithContext(
  (metamodel: PackageableRuntime, context): PackageableRuntime => {
    observe_Abstract_PackageableElement(metamodel);

    makeObservable<PackageableRuntime, '_elementHashCode'>(metamodel, {
      runtimeValue: observable,
      _elementHashCode: override,
    });

    observe_EngineRuntime(metamodel.runtimeValue, context);

    return metamodel;
  },
)
Example #15
Source File: DSLMapping_ObserverHelper.ts    From legend-studio with Apache License 2.0 6 votes vote down vote up
observe_PackageableConnection = skipObservedWithContext(
  (metamodel: PackageableConnection, context): PackageableConnection => {
    observe_Abstract_PackageableElement(metamodel);

    makeObservable<PackageableConnection, '_elementHashCode'>(metamodel, {
      connectionValue: observable,
      _elementHashCode: override,
    });

    observe_Connection(metamodel.connectionValue, context);

    return metamodel;
  },
)
Example #16
Source File: DSLMapping_ObserverHelper.ts    From legend-studio with Apache License 2.0 6 votes vote down vote up
observe_Mapping = skipObservedWithContext(
  (metamodel: Mapping, context): Mapping => {
    observe_Abstract_PackageableElement(metamodel);

    makeObservable<Mapping, '_elementHashCode'>(metamodel, {
      includes: observable,
      classMappings: observable,
      enumerationMappings: observable,
      associationMappings: observable,
      tests: observable,
      _elementHashCode: override,
    });

    metamodel.includes.forEach(observe_MappingInclude);
    metamodel.classMappings.forEach((classMapping) =>
      observe_SetImplementation(classMapping, context),
    );
    metamodel.enumerationMappings.forEach(observe_EnumerationMapping);
    metamodel.associationMappings.forEach((associationMapping) =>
      observe_AssociationImplementation(associationMapping, context),
    );
    metamodel.tests.forEach((test) => observe_MappingTest(test, context));

    return metamodel;
  },
)
Example #17
Source File: DSLGenerationSpecification_ObserverHelper.ts    From legend-studio with Apache License 2.0 6 votes vote down vote up
observe_GenerationSpecification = skipObserved(
  (metamodel: GenerationSpecification): GenerationSpecification => {
    observe_Abstract_PackageableElement(metamodel);

    makeObservable<GenerationSpecification, '_elementHashCode'>(metamodel, {
      generationNodes: observable,
      fileGenerations: observable,
      _elementHashCode: override,
    });

    metamodel.generationNodes.forEach(observe_GenerationTreeNode);
    metamodel.fileGenerations.forEach(observe_PackageableElementReference);

    return metamodel;
  },
)
Example #18
Source File: DSLGenerationSpecification_ObserverHelper.ts    From legend-studio with Apache License 2.0 6 votes vote down vote up
observe_FileGenerationSpecification = skipObserved(
  (metamodel: FileGenerationSpecification): FileGenerationSpecification => {
    observe_Abstract_PackageableElement(metamodel);

    makeObservable<FileGenerationSpecification, '_elementHashCode'>(metamodel, {
      type: observable,
      generationOutputPath: observable,
      scopeElements: observable,
      configurationProperties: observable,
      _elementHashCode: override,
    });

    metamodel.scopeElements.forEach((scopeElement) => {
      if (scopeElement instanceof PackageableElementReference) {
        observe_PackageableElementReference(scopeElement);
      }
    });
    metamodel.configurationProperties.forEach(observe_ConfigurationProperty);

    return metamodel;
  },
)
Example #19
Source File: DSLExternalFormat_ObserverHelper.ts    From legend-studio with Apache License 2.0 6 votes vote down vote up
observe_SchemaSet = skipObserved(
  (metamodel: SchemaSet): SchemaSet => {
    observe_Abstract_PackageableElement(metamodel);

    makeObservable<SchemaSet, '_elementHashCode'>(metamodel, {
      format: observable,
      schemas: observable,
      _elementHashCode: override,
    });

    metamodel.schemas.forEach(observe_ExternalFormatSchema);

    return metamodel;
  },
)
Example #20
Source File: DSLExternalFormat_ObserverHelper.ts    From legend-studio with Apache License 2.0 6 votes vote down vote up
observe_Binding = skipObserved((metamodel: Binding): Binding => {
  observe_Abstract_Store(metamodel);

  makeObservable<Binding, '_elementHashCode'>(metamodel, {
    schemaSet: observable,
    schemaId: observable,
    contentType: observable,
    modelUnit: observable,
    _elementHashCode: override,
  });

  observe_OptionalPackageableElementReference(metamodel.schemaSet);
  observe_ModelUnit(metamodel.modelUnit);

  return metamodel;
})
Example #21
Source File: DSLData_ObserverHelper.ts    From legend-studio with Apache License 2.0 6 votes vote down vote up
observe_DataElement = skipObservedWithContext(
  (metamodel: DataElement, context: ObserverContext): DataElement => {
    observe_Abstract_PackageableElement(metamodel);

    makeObservable<DataElement, '_elementHashCode'>(metamodel, {
      stereotypes: observable,
      taggedValues: observable,
      data: observable,
      _elementHashCode: override,
    });
    metamodel.stereotypes.forEach(observe_StereotypeReference);
    metamodel.taggedValues.forEach(observe_TaggedValue);
    observe_EmbeddedData(metamodel.data, context);
    return metamodel;
  },
)
Example #22
Source File: ESService_ObserverHelper.ts    From legend-studio with Apache License 2.0 6 votes vote down vote up
observe_ServiceStore = skipObservedWithContext(
  (metamodel: ServiceStore, context): ServiceStore => {
    observe_Abstract_PackageableElement(metamodel);

    makeObservable<ServiceStore, '_elementHashCode'>(metamodel, {
      description: observable,
      elements: observable,
      _elementHashCode: override,
    });

    metamodel.elements.forEach((element) =>
      observe_ServiceStoreElement(element, context),
    );

    return metamodel;
  },
)
Example #23
Source File: DSLText_ObserverHelper.ts    From legend-studio with Apache License 2.0 6 votes vote down vote up
observe_Text = skipObserved((metamodel: Text): Text => {
  observe_Abstract_PackageableElement(metamodel);

  makeObservable<Text, '_elementHashCode'>(metamodel, {
    type: observable,
    content: observable,
    _elementHashCode: override,
  });

  return metamodel;
})
Example #24
Source File: DSLPersistence_ObserverHelper.ts    From legend-studio with Apache License 2.0 6 votes vote down vote up
observe_Persistence = skipObserved(
  (metamodel: Persistence): Persistence => {
    observe_Abstract_PackageableElement(metamodel);

    makeObservable<Persistence, '_elementHashCode'>(metamodel, {
      documentation: observable,
      trigger: observable,
      service: observable,
      persister: observable,
      notifier: observable,
      _elementHashCode: override,
    });

    return metamodel;
  },
)
Example #25
Source File: DSLDataSpace_ObserverHelper.ts    From legend-studio with Apache License 2.0 6 votes vote down vote up
observe_DataSpace = skipObserved(
  (metamodel: DataSpace): DataSpace => {
    observe_Abstract_PackageableElement(metamodel);

    makeObservable<DataSpace, '_elementHashCode'>(metamodel, {
      _elementHashCode: override,
    });

    // metamodel.executionContexts.forEach(observe_DataSpaceExecutionContext);
    // observe_DataSpaceExecutionContext(metamodel.defaultExecutionContext);
    // if (metamodel.supportInfo) {
    //   observe_DataSpaceSupportInfo(metamodel.supportInfo);
    // }
    metamodel.stereotypes.forEach(observe_StereotypeReference);
    metamodel.taggedValues.forEach(observe_TaggedValue);

    return metamodel;
  },
)
Example #26
Source File: DomainObserverHelper.ts    From legend-studio with Apache License 2.0 5 votes vote down vote up
_observe_Abstract_Package = (metamodel: Package): void => {
  observe_Abstract_PackageableElement(metamodel);

  makeObservable(metamodel, {
    children: observable,
    hashCode: override,
  });
}
Example #27
Source File: apiKeys.ts    From jitsu with MIT License 5 votes vote down vote up
constructor() {
    super("api_keys", { idField: "uid" })
    makeObservable(this, {
      add: override,
      generateAddInitialApiKeyIfNeeded: flow,
    })
  }