If you want to return the object from the arrow function, you'll need to either use the return keyword:
const getObject = () => { return { key: 'value' }; };
Or use parentheses to make it an implicit return of an object literal:
const getObject = () => ({ key: 'value' });