scurker/currency.js

Why is not this working?

hirppa opened this issue · 2 comments

const test = currency(0);
test.add(1);

console.log(test.value); // 0 instead of 1

It's immutable.

const a = currency(0);
const b = a.add(1);

console.log(a.value); // 0
console.log(b.value); // 1

It's one of the main features:
image

Something like the example above from @eXamadeus should be in the readme. I know it says Immutable in the features but if this gets glossed over none of the examples address this.