functional js blocking event loop