-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
💥 (Aspect) Fix AspectPatch definition
This provides value to patch callback. - Add common extensions - WIP AspectBatch for performant Inheritable mutation #time: 35 minutes
- Loading branch information
Showing
2 changed files
with
53 additions
and
9 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,12 @@ | ||
import 'package:flutter/widgets.dart'; | ||
|
||
import 'inheritable.dart'; | ||
|
||
extension BoolAspectOf<T> on Aspect<bool, T> { | ||
Aspect<R, T> map<R>({R onTrue, R onFalse, Key key}) { | ||
return AspectChianingFn(this).map( | ||
(b) => b ? onTrue : onFalse, | ||
key, | ||
); | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters