- Notifications
You must be signed in to change notification settings - Fork 28
Closed
Labels
foundationalFoundational open questions whose resolution may change the model dramaticallyFoundational open questions whose resolution may change the model dramatically
Description
Continuing from #7 (comment), where @tbondwilkinson notes a sharp edge of the existing history.state API:
history.pushState({ test: 2 }, null, ''); console.log(history.state.test); // 2 history.state.test = 3; console.log(history.state.test); // 3 // refresh the page console.log(history.state.test); // 2That is, because it allows any arbitrary JavaScript object, it allows mutable JavaScript objects. But the object is only serialized into (semi-)persistent storage when you call history.pushState() or history.replaceState().
The current proposal duplicates this sharp edge with app history state. E.g.,
appHistory.push({ state: { test: 2 } }); console.log(appHistory.current.state.test); // 2 appHistory.current.state.test = 3; console.log(appHistory.current.state.test); // 3 // refresh the page console.log(appHistory.current.state.test); // 2This seems quite bad to me, and I think we should consider a way to fix it, if we can do so without interfering with other use cases. I'll post a reply with some suggestions.
Metadata
Metadata
Assignees
Labels
foundationalFoundational open questions whose resolution may change the model dramaticallyFoundational open questions whose resolution may change the model dramatically