Closed transitive-bullshit closed 4 months ago
The latest updates on your projects. Learn more about Vercel for Git ↗︎
Name | Status | Preview | Comments | Updated (UTC) |
---|---|---|---|---|
dexter | ✅ Ready (Inspect) | Visit Preview | 💬 Add feedback | Apr 21, 2024 2:46pm |
@rileytomasek fixed the missing context
deepMerge in datastores and addressed #18 as well.
@transitive-bullshit do you remember what’s left to complete if we wanted to merge this?
@rileytomasek this has been ready to review & merge for awhile :) I fixed the one missing issue after you took a quick pass initially.
@transitive-bullshit i saw this, and no commit message that appeared to address it, which is what prompted the qeustion:
TODO: add unit tests which verify immutability after .extend().
@transitive-bullshit i made it so events
and context
are fully cleared if an empty object is passed instead of being undefined
and added some tests.
i'm ready to merge and release this if you're on board with the changes.
Looks good to me 💪
debug: true
, it would add the debug events twice; now all event handlers get deduped while retaining a stable orderingAbstractModel.extend
andDatastore.extend
now support the oldclone
functionality as well as modifying any params@rileytomasek one note: the reason I had to remove the class methods for
merge*
was because we're now calling some of these in the constructor of subclasses beforesuper
is called, so the previous method which was nicer for typing no longer worked. I tried a few diff variations but ended up using what I think is a much cleaner replacement fordeepMerge
andmergeEvents
, which is a slight variation on the underlying package to cleanly handleundefined
parameters as empty objects. Also added unit tests for these changes.One downside to this approach is that it's difficult to reset events/params/context to an empty object, but I don't think this is too important since the user can still override individual fields on these objects to be
undefined
.TODO: add unit tests which verify immutability after
.extend()
.