1 import { put, takeEvery } from 'redux-saga/effects';
3 import { pinItem } from '@proton/pass/lib/items/item.requests';
4 import { itemPinFailure, itemPinIntent, itemPinSuccess } from '@proton/pass/store/actions';
6 function* itemPinWorker({ payload, meta: { request } }: ReturnType<typeof itemPinIntent>) {
8 yield pinItem(payload.shareId, payload.itemId);
9 yield put(itemPinSuccess(request.id, payload));
11 yield put(itemPinFailure(request.id, err));
15 export default function* watcher() {
16 yield takeEvery(itemPinIntent.match, itemPinWorker);