I'm trying to do this in ReasonML without success. The problem is that I don't know the object keys.
const items = {
foo: () => 'ok',
bar: () => 'ok2'
};
const result = Object.keys(items).reduce((acc, key) => ({
...acc, [key]: items[key]()
}), {});
console.log(result);