• Decorate a field to be automatically networked synced

    Parameters

    • Optional onFieldChanged: string | FieldChangedCallbackFn

      name of a callback function that will be called when the field is changed. You can also pass in a function like so: syncField(myClass.prototype.myFunctionToBeCalled)
      This function may return false to prevent notifyChanged from being called (for example a networked color is sent as a number and may be converted to a color in the receiver again) Parameters: (newValue, previousValue)

    Returns ((target, propertyKey) => void)

      • (target, propertyKey): void
      • Parameters

        • target: any
        • propertyKey: string

        Returns void

Generated using TypeDoc