v1.8.3
github-actions
released this
09 Jun 07:25
·
148 commits
to refs/heads/main
since this release
🐛 Bug Fixes
- fix
condition
method callingelse
branch whenthen
branch changespredicate
#204 (@sergeysova)
📚 Documentation
- fixes example for
delay
#200 (@zarabotaet)
🚀 Experimental
- Added experimental operators
and
,or
,not
,either
,equals
They're allow us to write logical conditions easily without much combines and maps:
// without logical operators
const $userExists = $user.map(user => user !== null);
const $isAttemptsMaximum = $numberOfAttempts.map(attempts => attempts >= ATTEMPTS_MAXIMUM);
sample({
clock,
source,
filter: combine(
$isAttemptsMaximum,
$cardActivated,
$restricted,
$userExists,
(isAttemptsMaximumx, activated, restricted, userExists) => !isAttemptsMaximum && activated && !restricted && userExists,
),
target,
})
// with these logical operators
const $isAttemptsMaximum = $numberOfAttempts.map(attempts => attempts >= ATTEMPTS_MAXIMUM)
sample({
clock,
source,
filter: and(
not($isAttemptsMaximum),
$cardActivated,
not(equals($user, null)),
not($restricted),
),
target,
})
It is experimental! Use on your own risk. Each method create a new store and calls
combine
under the hood.