You could always try:

```javascript
emit("onready", { "loggedInUser": currentUser || "safe state"});
```