Last active
June 25, 2023 08:44
-
-
Save yogithesymbian/deee81268cf47f112d9b1ea421376171 to your computer and use it in GitHub Desktop.
kotlin in dart (approach) https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/let.html
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
// its looks like a '.let' in kotlin , awesome !, dart | |
extension ObjectExt<T> on T { | |
R let<R>(R Function(T) x) => x(this); | |
} | |
// for example | |
/** | |
* we have nested json object for example data --> user --> | |
*/ | |
// data.user.let((p0) => { | |
// p0.id, | |
// p0.name | |
// }); | |
// so we don't need to define or use the attributes like these | |
// data.user.id | |
// data.user.name |
Author
yogithesymbian
commented
Aug 13, 2022
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment