spierala/mini-rx-store

Refactor: mini-rx-store: use @mini-rx/common lib

spierala opened this issue · 0 comments

Background

The MiniRx Signal Store uses the same concept as the original RxJS-based MiniRx Store. As a result there is a lot of code which can be shared between the two store solutions. For that reason the @mini-rx/common lib was created. @mini-rx/common is already used by the Signal Store.

See here the full public API of @mini-rx/common: https://github.com/spierala/mini-rx-store/blob/master/libs/common/src/index.ts

Task

  • Refactor MiniRx Store (mini-rx-store lib) to make use of the @mini-rx/common lib. Own custom implementations should be replaced with code from @mini-rx/common.
  • All public API of @mini-rx/common should be used by mini-rx-store (if not used directly, at least some code should be re-exported. See the Signal Store exporting some code from @mini-rx/common: https://github.com/spierala/mini-rx-store/blob/master/libs/signal-store/src/index.ts#L24-L42)
  • Signal Store should be used as orientation. In the end Signal Store and MiniRx Store should look quite identical. The main difference is that Signal Store is tailored to Angular Signals and MiniRx Store uses RxJS.

Subtasks

This is a quite large task. But is is definitely possible to create smaller sub-tasks:

Tests

mini-rx-signal store is covered by a lot of unit tests.
The tests will make the refactor relatively safe.

Indeed some tests can also be removed if mini-rx-store code is replaced with @mini-rx/common code.