couzic / lenrix

Type-safe, reactive, focusable redux store wrapper
MIT License
24 stars 1 forks source link

computeFrom() does not recompute when focused field is undefined #42

Closed couzic closed 6 years ago

couzic commented 6 years ago
  .computeFrom(
    _ => ({
      selectedCategoryProduct: _.focusPath(
        'productSelect',
        'selectedCategoryProduct',
      ),
    }),
    ({ selectedCategoryProduct }) => ({
      statsProductOptions:
        selectedCategoryProduct === undefined
          ? undefined
          : selectedCategoryProduct.products.map(toOption),
    }),
  )

Problem: statsProductOptions never get undefined

couzic commented 6 years ago

Wrong bug interpretation