Skip to content

Instantly share code, notes, and snippets.

Show Gist options
  • Save yogithesymbian/deee81268cf47f112d9b1ea421376171 to your computer and use it in GitHub Desktop.
Save yogithesymbian/deee81268cf47f112d9b1ea421376171 to your computer and use it in GitHub Desktop.
// 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
@yogithesymbian
Copy link
Author

Screen Shot 2022-08-13 at 9 57 28 AM

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment