volatile store

volatile means that the store is temporary and dynamic. Store will mount to system along with component, and unmount after component unmounted. Sometime we need local state also to react Message/Action, however react state can't be done. We need to lift the local state to Ractor system to catch Message. This is what dynamic store means.

Dialog Problem

Imagine you have a page A and a component Dialog rendered in A. In A, you have a button that want to tell Dialog to open. Now switch page A to page B, you should to unmount Dialog.

How do you do this with redux?

In Redux way, your need to initialize a Dialog state in redux store. But if switch A to B, Dialog has unmounted, the Dialog state is still in redux store. It's the problem.

In Ractor, because of the multiple stores and single event system architecture, we can mount or unmount store dynamically. Ractor can resolve this problem perfectly.

import { Connect } from "ractor-react"
import { DialogStore } from "./DialogStore"

@Connect(DialogStore)
class ReactComponent

results matching ""

    No results matching ""