You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
// member field.
@track({fieldName: 'fieldName'})privatefieldName='fieldName';// getter
@track({getName: 'getter() getMyName'})privategetgetMyName(){returnthis.parentMethod()+'my name';}privatehandleTrack=()=>{console.log('handleTrack: property decorator:',this.getMyName,this.fieldName);return{result: '({} as any).name.handleTrack',};}
for property decorate will lazy execute, it will result in
constresolvedValue=initializer
? Reflect.apply(initializer,this,[])
: Reflect.apply(get,this,[]);// resolvedValue value will be string, // but if we executeconstdecoratedValue=decorate(resolvedValue).bind(this);// will aways return us a function.
so maybe we need to do some check here like below code:
constdecoratedValue=isFunction(resolvedValue)
? decorate(resolvedValue,name).bind(this)// for getter, member field we need to direct evaluate this express. and get the final value to consumer.
: Reflect.apply(decorate(()=>resolvedValue,name),this,[]);
The text was updated successfully, but these errors were encountered:
if we need to decorator one property or getter()
for property decorate will lazy execute, it will result in
so maybe we need to do some check here like below code:
The text was updated successfully, but these errors were encountered: