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