-
Notifications
You must be signed in to change notification settings - Fork 14
Closed
Description
reactant-share
uses a one-to-many client design, which relies on class method
proxies that trigger the server's execution methods.
class Counter {
@state
count = 0;
@action
_increase() {
this.count += 1;
}
@proxy
async increase() {
this._increase();
}
async doSomething() {
await this.increase();
}
}
For developers, the principle of using @proxy
is difficult to grasp, and the decorated methods often have to be newly written in order to have to be asynchronous, thus necessitating a new simple asynchronous method, which is not worth it.
Therefore, reactant-share
requires a more flexible and simple C/S proxy model, and the actor model is well suited for such a design.
class Counter {
@state
count = 0;
@action
increase() {
this.count += 1;
}
async doSomething() {
await spawn(this, 'increase', []);
}
}
Metadata
Metadata
Assignees
Labels
No labels