File tree Expand file tree Collapse file tree 1 file changed +8
-2
lines changed Expand file tree Collapse file tree 1 file changed +8
-2
lines changed Original file line number Diff line number Diff line change @@ -12,19 +12,25 @@ function createGetter(key: string, options: NativePropertyOptions) {
1212 const converter = options . converter ;
1313 return function ( ) {
1414 let result ;
15+ if ( this [ '_' + key ] ) {
16+ return this [ '_' + key ] ;
17+ }
1518 if ( this . native && this . native [ nativeGetterName ] ) {
1619 result = this . native [ nativeGetterName ] ( ) ;
20+ result = converter ? converter . fromNative . call ( this , result , key ) : result ;
1721 } else {
1822 result = this . options [ key ] || options . defaultValue ;
1923 }
20- result = converter ? converter . fromNative . call ( this , result , key ) : result ;
2124 return result ;
2225 } ;
2326}
2427function createSetter ( key , options : NativePropertyOptions ) {
2528 const nativeSetterName = ( ( isAndroid ? options . android : options . ios ) || options ) . nativeSetterName || 'set' + key . charAt ( 0 ) . toUpperCase ( ) + key . slice ( 1 ) ;
2629 return function ( newVal ) {
27- this . options [ key ] = newVal ;
30+ if ( this [ '_' + key ] === newVal ) {
31+ return ;
32+ }
33+ this [ '_' + key ] = this . options [ key ] = newVal ;
2834 if ( this . native && this . native [ nativeSetterName ] ) {
2935 const actualVal = options . converter ? options . converter . toNative . call ( this , newVal , key ) : newVal ;
3036 this . native [ nativeSetterName ] ( actualVal ) ;
You can’t perform that action at this time.
0 commit comments