Predictable state container for JavaScript apps