32846194b6
The kredits module always returns raw data from the contract. For uint values these are bignumbers. To handle those in the ember app we need to convert them to string or to number.
14 lines
320 B
JavaScript
14 lines
320 B
JavaScript
import computed from 'ember-computed';
|
|
|
|
export default function(dependentKey, converterMethod) {
|
|
return computed(dependentKey, {
|
|
get () {
|
|
return this.get(dependentKey)[converterMethod]();
|
|
},
|
|
set (key, value) {
|
|
this.set(dependentKey, value);
|
|
return value[converterMethod]();
|
|
}
|
|
});
|
|
}
|