Simulate a state-setter function without React.
updater(
function applyUpdater(state, updater) { // TODO }