effector/require-pickup-in-persist
Requires every persist
call of the effector-storage
library to include a pickup
event when using Scope
s. This ensures the correct initial value is loaded into the store for each Scope
.
ts
import { persist } from "effector-storage/query";
const $store = createStore("example");
// 👎 no pickup, does not work with Scope
persist({ store: $store });
ts
const pickup = createEvent();
// 👍 pickup is specified
persist({ store: $store, pickup });