You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Yes, I understand your point and I agree.
I remember I was trying to find a way to test a gen_server without caring too much about the OTP details: so to test a "deploy" I ended up to test handle_deploy(Service, State) rather than handle_call({deploy, Service}, From, State) in which there is noise of the OTP framework (think abuout From) and the operation has to be understood from the real message sent rather than the function name. Obviously a test should be done in a certain state and could operate on the state itself, here the strange state passing.
Anyway I agree that is less clear and not the correct approach, I've tagged the issue as refactoring 👍
example:
https://github.com/mobos/mob/blob/master/apps/mob/src/mob.erl#L124-L134
why do you pass around state? probably you can extract from the state the variable you need in the previous function.
Benefits:
The text was updated successfully, but these errors were encountered: