Closed chrisvxd closed 2 months ago
The latest updates on your projects. Learn more about Vercel for Git ↗︎
Name | Status | Preview | Comments | Updated (UTC) |
---|---|---|---|---|
puck-demo | ✅ Ready (Inspect) | Visit Preview | 💬 Add feedback | Sep 9, 2024 8:58pm |
puck-docs | ✅ Ready (Inspect) | Visit Preview | 💬 Add feedback | Sep 9, 2024 8:58pm |
Rework the history store to ensure intialHistories API works as expected. Previously, the historyStore would assume that
data
was the first item in history, and all history was additive. This PR reverses the logic, placingdata
at the end of the history to enable injection of custom histories.Changes:
initialHistories
mandatory internally when using theuseHistoryStore
hookEMPTY_HISTORY_INDEX
to0
instead of-1
, since some history always existsdata
propid
parameter inHistory
typeBefore
Default history store:
Injecting history via
initialHistories
prop APIAfter
Default history store
or when injecting via API
@mkilpatrick I think this should help with your challenges in #562. You can test this via 0.16.0-canary.464aa1e. I'd love to get this in ASAP as this API is now one of the things blocking release of v0.16.