Skip to content

Latest commit

 

History

History
52 lines (46 loc) · 1.76 KB

MIGRATING.md

File metadata and controls

52 lines (46 loc) · 1.76 KB

Migrating Guide

From 5.X.X to 6.0.0

Deprecated

Breaking changes

  • replace action is removed, use add action
  • orderBy action is removed
    • You can write your own with a middleware
    • You can use k-ramel to handle your logical code and use k-redux-factory for the key/value store only
    • You can use redux-saga to handle your logical code and use k-redux-factory for the key/value store only
  • factory export is not the default one
    • Before: import factory, { keyValue } from 'k-redux-factory'
    • Now: import { factory, keyValue } from 'k-redux-factory'
  • state created by k-redux-factory is modified to be less bloated when serialized:
    • getState selector returns a new shape, see dedicated chapter
    • all other selectors work as before 👌

State

The state shape used by k-redux-factory is changed to be less bloated when serialized. Under the hood we use Javascript Map object.

This is a breaking change when you:

  • manually retrieve the substate from a k-redux-factory reducer
  • or use the getState selector

All other selectors work as before 👌

k-redux-factory v5.x.x

{
  data: { <key1>: <instance1>, <key2>: <instance2> },
  array: [<instance1>, <instance2>],
  keys: [<key1>, <key2>],
  initialized: true,
}

k-redux-factory v6.0.0

{
  data: [
    [<key1>, <instance1>],
    [<key2>, <instance2>],
  ],
  initialized: true,
}