Interface Binding<LeftPropName, RightPropName>

Class for two way binding between bindables.

Type Parameters

  • LeftPropName extends PropertyName = string

  • RightPropName extends PropertyName = string

Hierarchy

  • Binding

Methods

  • Bind two bindables to each other

    Parameters

    Returns Binding<LeftPropName, RightPropName>

    Example

    Binding.create().bindTo(esriAccessor, vueComponent);
    
  • Stop watching for changes on bindables

    Returns Binding<LeftPropName, RightPropName>

    Example

    Binding.for(esriAccessor, vueComponent).enable().disable();
    
  • Start watching for changes on bindables

    Returns Binding<LeftPropName, RightPropName>

    Example

    Binding.for(esriAccessor, vueComponent).enable();
    
  • Semantically equivalent to unbind. It is provided to allow simpler registration of cleanups as event handles.

    Returns Binding<LeftPropName, RightPropName>

    Example

    let dijitWidget= ...
    let binding = Binding.create();
    ...
    // clean up binding if widget is destroyed
    dijitWidget.own(binding);
  • Define properties to be synchronized and converted between two bindables. Represents a combination of syncToRight/syncToLeft

    Parameters

    • leftProperty: LeftPropName | LeftPropName[]
    • rightProperty: RightPropName | RightPropName[]
    • Optional convertLeftToRight: ConvertFunction

      if omitted, updated value will not be converted

    • Optional convertRightToLeft: ConvertFunction

      if omitted, updated value will not be converted

    Returns Binding<LeftPropName, RightPropName>

    Example

    Binding.for(esriAccessor, vueComponent).sync('textField', 'numberField', Number, String);
    
  • Define properties to be synchronized between two bindables.

    Parameters

    • properties: Partial<Record<LeftPropName, RightPropName>>

    Returns Binding<LeftPropName, RightPropName>

    Example

    // synchronize between properties with same names
    Binding.for(esriAccessor, vueComponent).syncAll('textField', 'otherTextField');

    // synchronize between properties with different names
    Binding.for(esriAccessor, vueComponent).syncAll({
    'latitude: 'x',
    'longitude: 'y'
    });
  • Define properties to be synchronized between from left to right bindables.

    Parameters

    • properties: Partial<Record<RightPropName, LeftPropName>>

    Returns Binding<LeftPropName, RightPropName>

    Example

    // synchronize between properties with same names
    Binding.for(esriAccessor, vueComponent).syncAllToLeft('textField', 'otherTextField');

    // synchronize between properties with different names
    Binding.for(esriAccessor, vueComponent).syncAllToLeft({
    'latitude: 'x',
    'longitude: 'y'
    });
  • Define properties to be synchronized between from left to right bindables.

    Parameters

    • properties: Partial<Record<LeftPropName, RightPropName>>

    Returns Binding<LeftPropName, RightPropName>

    Example

    // synchronize between properties with same names
    Binding.for(esriAccessor, vueComponent).syncAllToRight('textField', 'otherTextField');

    // synchronize between properties with different names
    Binding.for(esriAccessor, vueComponent).syncAllToRight({
    'latitude: 'x',
    'longitude: 'y'
    });
  • Define properties to be synchronized and converted from right bindable to left bindable

    Parameters

    • rightProperty: RightPropName | RightPropName[]
    • leftProperty: LeftPropName | LeftPropName[]
    • Optional convertValue: ConvertFunction

      if omitted, updated value will not be converted

    Returns Binding<LeftPropName, RightPropName>

    Example

    Binding.for(esriAccessor, vueComponent).syncToLeft('numberField', 'textField', String);
    
  • Trigger the synchronization of the properties of right to their pedants on left.

    Returns Binding<LeftPropName, RightPropName>

  • Define properties to be synchronized and converted from left bindable to right bindable

    Parameters

    • leftProperty: LeftPropName | LeftPropName[]
    • rightProperty: RightPropName | RightPropName[]
    • Optional convertValue: ConvertFunction

      if omitted, updated value will not be converted

    Returns Binding<LeftPropName, RightPropName>

    Example

    Binding.for(esriAccessor, vueComponent).syncToRight('textField', 'numberField', Number);
    
  • Trigger the synchronization of the properties of left to their pedants on right.

    Returns Binding<LeftPropName, RightPropName>

  • Unbind two models from each other

    Returns Binding<LeftPropName, RightPropName>

Generated using TypeDoc