Though you need to replace:
return thunk;
with: return () => thunk();
Otherwise the assignment in thunk does nothing. return thunk;
with: return () => thunk();
Otherwise the assignment in thunk does nothing.