Open itsmontoya opened 7 years ago
The issue is that data put into the history will be serialized by the browser. In turn, when you get it back out, you won't get an object of the Go type you put in. That makes the API rather awkward to use.
@dominikh I understand there might be an issue here with the state field. I know currently, this value is not required by the browser. AFAIK it's used as an optional object. Instead of an interface{}, do you think it might be better suited to utilize a map[string]string or even a map[string]interface{}?
@shurcooL - I made some changes based on your request. Please let me know if I missed anything
Sorry to follow up @dominikh - just wanted to see if you had any suggestions. I want you to be satisfied with the implementation. At the same time, I really need window.History on my current project. :D
The issue is that data put into the history will be serialized by the browser. In turn, when you get it back out, you won't get an object of the Go type you put in. That makes the API rather awkward to use.
Would it make sense to use *js.Object
type for state? I know it's not pretty, but at least you'd get back what you put in, right?
I'm deferring this PR, and all decisions, to @shurcooL.
@shurcooL - Reported issue was fixed, I also made an additional fix of similar nature to "back"
Following up here. @itsmontoya, have you seen my question in https://github.com/dominikh/go-js-dom/pull/35#issuecomment-268923431?
Resolves #41.