Skip to content

Latest commit

 

History

History
10 lines (8 loc) · 594 Bytes

filter.md

File metadata and controls

10 lines (8 loc) · 594 Bytes

Filter

  • Filter is used to optimize the performance of the Reducer. Because the Reducer is layer-assembled, each Action is processed, and in theory, all the small Reducers are traversed. In some very complicated scenarios, such a deep traversal may take up to the millisecond level (generally Should be less than 1 millisecond). Then we need to optimize the performance of the Reducer, decide in advance whether to traverse this Reducer subtree, reduce the depth and number of traversal.
  • Sample Code
bool filter(Action action) {
    return action.type == 'some action';
}