Asynchronous State Helper for Javascript