Skip to content

Commit

Permalink
js: Add _ref property in view,store ref, for combine action in mobx
Browse files Browse the repository at this point in the history
  • Loading branch information
penfeizhou committed Sep 16, 2022
1 parent b496be1 commit d9c376f
Show file tree
Hide file tree
Showing 8 changed files with 12 additions and 0 deletions.
1 change: 1 addition & 0 deletions doric-js/bundle/doric-lib.es5.js
Original file line number Diff line number Diff line change
Expand Up @@ -425,6 +425,7 @@ var View = /** @class */ (function () {
Object.defineProperty(View.prototype, "ref", {
set: function (ref) {
ref.current = this;
this._ref = ref;
},
enumerable: false,
configurable: true
Expand Down
1 change: 1 addition & 0 deletions doric-js/bundle/doric-lib.js
Original file line number Diff line number Diff line change
Expand Up @@ -345,6 +345,7 @@ class View {
}
set ref(ref) {
ref.current = this;
this._ref = ref;
}
doAnimation(context, animation) {
return this.nativeChannel(context, "doAnimation")(animation.toModel()).then((args) => {
Expand Down
1 change: 1 addition & 0 deletions doric-js/bundle/doric-vm.js
Original file line number Diff line number Diff line change
Expand Up @@ -1875,6 +1875,7 @@ class View {
}
set ref(ref) {
ref.current = this;
this._ref = ref;
}
doAnimation(context, animation) {
return this.nativeChannel(context, "doAnimation")(animation.toModel()).then((args) => {
Expand Down
1 change: 1 addition & 0 deletions doric-js/index.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -648,6 +648,7 @@ declare module "doric" {
flexConfig?: FlexConfig;
set props(props: Partial<this>);
set parent(v: Group);
private _ref?;
set ref(ref: Ref<this>);
doAnimation(context: BridgeContext, animation: IAnimation): Promise<void>;
clearAnimation(context: BridgeContext, animation: IAnimation): Promise<void>;
Expand Down
1 change: 1 addition & 0 deletions doric-js/lib/src/ui/view.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -135,6 +135,7 @@ export declare abstract class View implements Modeling {
flexConfig?: FlexConfig;
set props(props: Partial<this>);
set parent(v: Group);
private _ref?;
set ref(ref: Ref<this>);
doAnimation(context: BridgeContext, animation: IAnimation): Promise<void>;
clearAnimation(context: BridgeContext, animation: IAnimation): Promise<void>;
Expand Down
1 change: 1 addition & 0 deletions doric-js/lib/src/ui/view.js
Original file line number Diff line number Diff line change
Expand Up @@ -227,6 +227,7 @@ export class View {
}
set ref(ref) {
ref.current = this;
this._ref = ref;
}
doAnimation(context, animation) {
return this.nativeChannel(context, "doAnimation")(animation.toModel()).then((args) => {
Expand Down
3 changes: 3 additions & 0 deletions doric-js/src/ui/view.es5.ts
Original file line number Diff line number Diff line change
Expand Up @@ -373,8 +373,11 @@ export abstract class View implements Modeling {
this.in(v)
}

private _ref?: Ref<this>;

set ref(ref: Ref<this>) {
ref.current = this
this._ref = ref;
}

doAnimation(context: BridgeContext, animation: IAnimation) {
Expand Down
3 changes: 3 additions & 0 deletions doric-js/src/ui/view.ts
Original file line number Diff line number Diff line change
Expand Up @@ -382,8 +382,11 @@ export abstract class View implements Modeling {
this.in(v)
}

private _ref?: Ref<this>;

set ref(ref: Ref<this>) {
ref.current = this
this._ref = ref;
}

doAnimation(context: BridgeContext, animation: IAnimation) {
Expand Down

0 comments on commit d9c376f

Please sign in to comment.