Skip to content

Commit

Permalink
# 4.3.0 2022-04-06
Browse files Browse the repository at this point in the history
* [design] add [flow](/experience?id=flow-experience) and [effect](/experience?id=effect-decorator-experience).
* [design] add experience, set `process.env.AGENT_REDUCER_EXPERIENCE` to `OPEN`, can use the experience features.
  • Loading branch information
wangyi committed Apr 6, 2022
1 parent c1534e3 commit 370c544
Show file tree
Hide file tree
Showing 30 changed files with 2,278 additions and 571 deletions.
4 changes: 2 additions & 2 deletions docs/api.md
Original file line number Diff line number Diff line change
Expand Up @@ -631,13 +631,13 @@ Listen the model state change, and do something to complete work.
export declare function addEffect<S=any, T extends Model<S> = Model>(
effectCallback:EffectCallback<S>,
target:T,
method?:keyof T|((...args:any[])=>any),
method?:keyof T|((...args:any[])=>any)|'*',
):EffectWrap<S, T>;
```
* effectCallback - the function to process the effect of state change, the function returns void or a destroy function which is always called before the effectCallback works again or when the effect is unmounted.
* target - a model instance or agent as a listening target.
* method - optional, if you want filter the state change from specific method, you can add it.
* method - optional, if you want filter the state change from specific method, you can add it. When this param is `*`, it means the effect listen to all the method state changes.
It returns a `effect` object, which provides `update` and `unmount` methods. The `update` method can be used to update effectCallback, and the `unmount` method can be used to unmount effect manually from model instance.
Expand Down
7 changes: 6 additions & 1 deletion docs/changes.md
Original file line number Diff line number Diff line change
Expand Up @@ -175,4 +175,9 @@ in this version, `runtime.cache` used in MiddleWare is independent.

# 4.2.5 2022-03-22

* [bug] repair the problem about when all the connections from agents are disconnected, the method effect may still work, and change state, if it is a asynchronous method.
* [bug] repair the problem about when all the connections from agents are disconnected, the method effect may still work, and change state, if it is a asynchronous method.

# 4.3.0 2022-04-06

* [design] add [flow](/experience?id=flow-experience) and [effect](/experience?id=effect-decorator-experience).
* [design] add experience, set `process.env.AGENT_REDUCER_EXPERIENCE` to `OPEN`, can use the experience features.
Loading

0 comments on commit 370c544

Please sign in to comment.