Starts with version 3.4.15, please see commit history for earlier changes.
- Chore: Upgrade lit to 2.7.2
- Chore: Upgrade lit to 3.0.2
- Chore: Upgrade lit to 3.1.1
- Feat(set-state): Added options parameter with entryPath for easier state navigation
- Feat(set-state): Correctly type and describe entryPath
- Feat(deepReduce): Exempt "Element"
- Chore(deps): Upgrade dependencies
- Chore(Readme): Fix typos
- Chore(deps): Bump versions
- Fix(types): Add StateEntryPath type
- Fix(types): Refine State EntryPath type
- WIP(state-path): Replace all other path definitions by StatePath
- fix(getSubscriptionData): Fix condition for array index segments
- fix(litElementStateful): Fix typing
- Chore(Changelog): Add breaking changes
This version replaces the parameter based targeting of state with an array based approach, the new StatePath
interface.
To subscribe state the function call was:
LitElementStateful.connectState(
"path", "to", "my", "state", "myLitElementProperty", { options }
)
or
LitElementStateful.subscribeState(
"path", "to", "my", "state", "myLitElementProperty", stateChange => { ...do something with stateChange... }, { options }
)
or
LitElementStateService.subscribe(
"path", "to", "my", "state", stateChange => { ...do something with stateChange... }, { options }
)
This becomes:
LitElementStateful.connectState(
["path", "to", "my", "state"], "myLitElementProperty", { options }
)
or
LitElementStateful.subscribeState(
["path", "to", "my", "state"], "myLitElementProperty", stateChange => { ...do something with stateChange... }, { options }
)
or
LitElementStateService.subscribe(
["path", "to", "my", "state"], stateChange => { ...do something with stateChange... }, { options }
)
This makes it easier to type the path and also to reuse paths as variables.
This version moves the cacheHandler parameter on the LitElementStateful.setState
& LitElementStateService.set
methods into a SetStateOptions
object.
When cacheHandlers have been used like e.g.:
setSate(
{ myProp: 'test' },
'myCacheHandlerName'
)
the usages have to be re-written to:
setSate(
{ myProp: 'test' },
{ cacheHandlerName: 'myCacheHandlerName' }
)
- Chore(Readme): Update Readme
- Chore: Update version
- Fix(typing): Reduce typing support for StatePath to 10 levels max
- Fix(typing): Reduce typing support for StatePath to 6 levels max
- Fix(typing): Revert to recursive type with additional condition
- Fix(typing): Make state object "Required" in StatePath
- Fix(StatePath): Change to non-recursive typing, revert array element selection
Since recursive typing proved to be super slow for large states and impossible to properly use intellisense, I had to revert to multiple function overloads. As a consequence the StatePath array element selection had to be changed / reverted:
['library', 'books', 1] or ['library', 'books', book => book.title === 'Harry Potter']
Needs to be reverted to that:
['library', { array: 'books', get: 1}] or ['library', { array: 'books', get: book => book.title === 'Harry Potter'}]
- Fix(deep-reduce): Add Date to exceptions from deepReduce
- fix(cacheHandlers): Improve array handling for localstorage cacheHandler
- fix(cacheHandlers): Fix typing error in localstorage cacheHandler
- fix(cacheHandlers): Fix array merge error in localstorage cacheHandler
- fix(cacheHandlers): Fix path creation in localstorage cacheHandler
- fix(cacheHandlers): Fix path creation in localstorage cacheHandler
- fix(cacheHandlers): Take full path in localstorage cacheHandler on array update
- fix(cacheHandlers): Fix loading of array from localstorage