Skip to content
This repository has been archived by the owner on Oct 19, 2023. It is now read-only.
/ RefOutBoxDart Public archive

Wrapping values so that they can be passed by reference, like c#'s ref out

License

Notifications You must be signed in to change notification settings

MeowType/RefOutBoxDart

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

9 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

pub MIT


Wrapping values so that they can be passed by reference, like c#'s ref out

Example

void tryDoSome(Out<bool> out) {
  trySetVal(out, true);
}
final out = Out<bool>();

tryDoSome(out);

out.val; // true

void addRef(Ref<int> ref) {
  tryChangeVal(ref, (val) => val + 1);
}
final ref = Ref(1);

addRef(ref);
addRef(ref);

ref.val; // 3

About

Wrapping values so that they can be passed by reference, like c#'s ref out

Topics

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages