Replies: 1 comment 5 replies
-
"Yes, but no." Here's something that is always safe, and can be done for "namespaces" since Dart doesn't really have a proper modules system: class A {
static int a(CapsuleHandle use) => 0;
}
container.read(A.a); Note that I normally would just recommend using a top-level function instead though. You should almost never need to write a class manually when using ReArch. Here's two things that are sometimes safe (but I would almost never recommend): class A {
int call(CapsuleHandle use) => 0;
}
class B {
int foobarCapsule(CapsuleHandle use) => 0;
}
container.read(A());
container.read(B().foobarCapsule); If you are doing one of those last two, it is only safe if you memoize the object that is being used to read the capsules. I.e., you can only ever pass in the same |
Beta Was this translation helpful? Give feedback.
-
Can a
Capsule
be a class method?Beta Was this translation helpful? Give feedback.
All reactions