squants icon indicating copy to clipboard operation
squants copied to clipboard

MoneyContext should be abstract class

Open pocman opened this issue 9 years ago • 5 comments

Hi, I'm trying to tweak the MoneyContext but being a case class make it really hard. Could we create an abstraction ?

pocman avatar Nov 24 '16 23:11 pocman

@pocman I am beginning to take a look at this. This should be easy enough to do. What you're trying to tweak? I'd like to keep your use cases in mind and perhaps base the tests on them.

garyKeorkunian avatar Mar 31 '17 14:03 garyKeorkunian

As this would break binary compatibility, this will be slated for the 2.x series.

garyKeorkunian avatar Apr 07 '17 17:04 garyKeorkunian

I'd like to second this. I want to write a MoneyContext that makes an external API call for the currency requested. Loading everything in advance eats away my maximum allowed API calls.

mhriemers avatar Apr 16 '19 18:04 mhriemers

Hmm? That means you would be adding a latent operation to an otherwise synchronous method. We may need to implement Future based operations on MoneyContext to support that. Of course, that depends on your implementation, @ipsq. Have you gotten that far?

garyKeorkunian avatar Apr 16 '19 19:04 garyKeorkunian

That wasn’t an issue for me personally because I only use this library for Ammonite. This does feel like a complicated issue that needs a lot of thought. If it would introduce a separate dependency, say cats-effect, I do recommend releasing a separate module.

mhriemers avatar Apr 16 '19 21:04 mhriemers