effector / patronum

☄️ Effector operators library delivering modularity and convenience ✨
https://patronum.effector.dev
MIT License
297 stars 43 forks source link

Introduce `skip` and `take` operators #339

Open rokashkovvd opened 1 month ago

rokashkovvd commented 1 month ago

Description

I think everyone had to write logic for limiting calls to effects or events. For example, limiting the number of repeated requests (take) or displaying some kind of warning if the user abuses a button or other interactive element (skip). They are based on abstract and repeating elements that can be put into separate operators - skip & take.

These operators were inspired by their rxjs analogs: skip - https://rxjs.dev/api/index/function/skip; take - https://rxjs.dev/api/index/function/take.

I know the effector API tries to be minimalistic. I agree with this. But I don't consider these particular operators redundant. If you think otherwise, you can safely close this PR by writing feedback.

In case of positive feedback, I am ready to complete the entire checklist for adding new operators and follow your comments in order to bring these operators to release.

Checklist for a new method