agilgur5 / agilgur5/mst-persist

Add configurable initial merge strategies

Open
#5 3 comments 1 reaction 0 assignees View on GitHub
kind: feature solution: workaround available
Dominant language
TypeScript
Stars
86
Forks
14
PR merge metrics
No merged PRs in 30d

Description

Per my comments in https://github.com/agilgur5/mst-persist/issues/1#issuecomment-508253724, should support something like [`redux-persist`'s State Reconcilers](https://github.com/rt2zz/redux-persist#state-reconciler) as merge strategies. This is basically just to handle state created in `.create(...)`, unless `persist` is called after some actions have been performed (which wouldn't be the standard usage, but is possible 🤷‍♂).

`applySnapshot` is equivalent to `hardSet` but with the model's defaults added. Users should be able to configure if they want a different merge strategy like a shallow merge (`autoMergeLevel1`).

Contributor guide

No contributing guide indexed for this repository

Research direction

Start with the persistence and hydration entry points in the repository, then read the linked discussion in issue #1 and the redux-persist state reconciler documentation. Define how configurable strategies interact with defaults created in .create(...) and with applySnapshot; done means callers can select the existing hard-set behavior or a documented shallow-merge alternative.

Written by the indexing model from the issue text.

Assessment

Tech stack
typescript
Domain
frontend
Issue type
Feature
Difficulty
5/5
Estimated time
Over a week
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
25/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.