effector / effector/farfetched

Barrier: Add cancelation policy option

Open
#509 0 comments 0 reactions 0 assignees View on GitHub
scope:core
Dominant language
TypeScript
Stars
221
Forks
36
PR merge metrics
No merged PRs in 30d

Description

Currently, the Barrier is mainly designed for cases involving token refresh and retrying operations. However, there can also be cases where an operation needs to be simply canceled without waiting for the Barrier to become inactive. For example, if an operation requires authorization and we just want to show the user a notification that they need to log in to perform the action. In such cases, blocked operations will accumulate, and when the user logs in, they will all be executed.

As a solution, we can add an option such as "cancelationPolicy", where the developer can specify whether the operation should be immediately canceled or postponed until the barrier is became inactive (as in the token expiration case).

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.