foundry icon indicating copy to clipboard operation
foundry copied to clipboard

Deprecate `addState()` in favor of `withAttributes()`

Open mpdude opened this issue 2 years ago • 2 comments

What is the semantic difference between using Factory::addState() and Factory::withAttributes()?

The former seems to simply dispatch to the latter.

Is there more intention behind it and should I be careful when I use which?

mpdude avatar Jul 05 '23 12:07 mpdude

No difference, it's really just a way to be more explicit when writing state methods. I think I'd be ok to deprecate addState - wdyt @nikophil?

kbond avatar Jul 10 '23 10:07 kbond

yes, I'm fine with it, moreover, in the version with "split factories", addState() and withAttributes() are in the same class

nikophil avatar Jul 11 '23 09:07 nikophil

Fixed in #493.

kbond avatar Mar 20 '24 16:03 kbond