effector-storage icon indicating copy to clipboard operation
effector-storage copied to clipboard

Add `@@trigger` protocol support for `pickup` option

Open yumauri opened this issue 1 year ago • 1 comments

https://withease.pages.dev/protocols/trigger.html

import { trackNetworkStatus } from '@withease/web-api';

persist({
  store: $store,
  pickup: trackNetworkStatus
})

yumauri avatar Jul 07 '23 17:07 yumauri

@@trigger protocol requires calling setup event, but for persist pickup is actually an analogue of setup. So, there is a loop, to add trigger to pickup we need to call pickup, which is trigger...

Maybe introduce new options setup and teardown?

yumauri avatar Jul 08 '23 12:07 yumauri