Here's a simple example:
let localStorage = JSObjectRef.global.localStorage.object!
print(localStorage.getItem!("hello"))
_ = localStorage.setItem!("hello", "world")
print(localStorage.getItem!("hello"))
Prints null then .string("world") as expected.
However, if you refresh the site after the value is set, it crashes with Reflect.get called on non-object.
Here's a simple example:
Prints
nullthen.string("world")as expected.However, if you refresh the site after the value is set, it crashes with
Reflect.get called on non-object.