mobx#flowResult TypeScript Examples

The following examples show how to use mobx#flowResult. 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: QueryBuilderPostFilterState.ts    From legend-studio with Apache License 2.0 6 votes vote down vote up
*changeColumn(
    columnState: QueryBuilderProjectionColumnState,
  ): GeneratorFn<void> {
    try {
      const aggregateColumnState =
        this.postFilterState.queryBuilderState.fetchStructureState.projectionState.aggregationState.columns.find(
          (column) => column.projectionColumnState === columnState,
        );
      const colState = aggregateColumnState ?? columnState;
      if (colState instanceof QueryBuilderDerivationProjectionColumnState) {
        yield flowResult(colState.fetchDerivationLambdaReturnType());
      }

      //column
      this.setColumnState(colState);

      //operator
      if (!this.operator.isCompatibleWithPostFilterColumn(this)) {
        this.setOperator(guaranteeNonNullable(this.operators[0]));
      }

      // value
      if (!this.operator.isCompatibleWithConditionValue(this)) {
        this.setValue(this.operator.getDefaultFilterConditionValue(this));
      }
    } catch (error) {
      assertErrorThrown(error);
      this.postFilterState.queryBuilderState.applicationStore.notifyError(
        `Can't drag column '${columnState.columnName}' due to: ${error.message}`,
      );
    }
  }