Skip to content

Commit c7f06b0

Browse files
committed
[fix] Property Descriptor bug of watch decorator
1 parent c9fe122 commit c7f06b0

3 files changed

Lines changed: 4 additions & 4 deletions

File tree

MobX/package.json

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "mobx-web-cell",
3-
"version": "0.4.0-rc.2",
3+
"version": "0.4.0-rc.3",
44
"license": "LGPL-3.0",
55
"author": "shiy2008@gmail.com",
66
"description": "MobX adaptor for WebCell v2",
@@ -24,7 +24,7 @@
2424
},
2525
"dependencies": {
2626
"mobx": ">4.0.0 <6.0.0",
27-
"web-cell": "^2.4.0-rc.3"
27+
"web-cell": "^2.4.0-rc.4"
2828
},
2929
"devDependencies": {
3030
"@parcel/packager-ts": "^2.2.1",

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "web-cell",
3-
"version": "2.4.0-rc.3",
3+
"version": "2.4.0-rc.4",
44
"description": "Web Components engine based on JSX & TypeScript",
55
"keywords": [
66
"web",

source/decorator.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -33,7 +33,7 @@ export function watch(
3333
key: string,
3434
meta?: PropertyDescriptor
3535
) {
36-
const accessor = !!meta;
36+
const accessor = !!(meta?.get || meta?.set);
3737
meta = meta || Object.getOwnPropertyDescriptor(prototype, key) || {};
3838

3939
meta.set =

0 commit comments

Comments
 (0)