8000 window.History() is not implemented. · Issue #41 · dominikh/go-js-dom · GitHub
[go: up one dir, main page]

Skip to content

window.History() is not implemented. #41

Open

Description

@FlorianUekermann

window.History() returns nil
There is a pull request, from half a year ago.

Activity

  1. dmitshur commented on Jul 17, 2017

    @dmitshur
    SponsorCollaborator

    The pull request which attempts to fix this is #35.

    I'll try to find time soon to look at it again.

    The reason it wasn't merged long ago is because it's still unclear what type to use for representing state. The PR currently uses interface{}, but I want to confirm whether or not that's the best API to go with.

  2. changed the title [-]Can't obtain window.history[/-] [+]window.History() is not implemented.[/+] on Jul 17, 2017
  3. inliquid commented on Jul 12, 2019

    @inliquid
    Contributor

    @dominikh any idea when will this be implemented? I'm using dom lib but have to revert to gopherjs/gopherjs/js in this particular case.

  4. mihaiav commented on Nov 2, 2019

    @mihaiav

    any update on this? in browser state is a javascript/json object defined by the user/client so I guess interface is the "right" go type. What else does Go use to define "any" type?

  5. mihaiav commented on Nov 2, 2019

    @mihaiav

    After a bit more consideration I believe this is a bit more complex and I don't really understand what value type history.Get returns or history.Set expects . Ideally we should marshal/unmarshal the state before to send it to make sure it's encoded per our specifications but I'm not sure if syscall/js is happy with our encoded json

    e.g.

    func (h *history) State(v interface{})error{
     raw_json := h.Get("state")
    return json.Unmarshal([]byte(raw_json), v)
    }
    
    
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions

      0