Checking a value against an 'enum'

I’m using Object.freeze to create an immutable object which I use as an enum.
But when I check a value against my enum, Aurelia generates a many warnings saying:

WARN [observer-locator] Cannot add observers to object {yes: 1, no: 0}
WARN [property-observation] Cannot observe property ‘yes’ of object {yes: 1, no: 0}

Here is a sandbox example:

I want to get rid of the warnings.
I know one workaround is to create a computed property, but I would prefer to access the immutable object directly from the view.

Any suggestion?

1 Like

Thats not going to work with frozen objects, since Aurelia adds a __observers__ prop to track the changes of the object itself.

image

2 Likes