16 lines
401 B
JavaScript
16 lines
401 B
JavaScript
import computed from 'ember-computed';
|
|
import ethers from 'npm:ethers';
|
|
|
|
export default function(dependentKey, converterMethod) {
|
|
return computed(dependentKey, {
|
|
get () {
|
|
return this.get(dependentKey)[converterMethod]();
|
|
},
|
|
set (key, value) {
|
|
value = ethers.utils.bigNumberify(value);
|
|
this.set(dependentKey, value);
|
|
return value[converterMethod]();
|
|
}
|
|
});
|
|
}
|