Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
function* filterUpdatableEntity(action: LoadEntitySuccess) {
const recognizer: PatternRecognizer = (yield getContext(ReduxTypes.Context)).get(
PatternTypes.Recognizer
);
const updatable: Updatable | undefined = recognizer.recognizeUniqueProperty(
action.payload.entity,
prop => !!(prop as Updatable).update
);
if (updatable) {
const accessControlAction: LoadAccessControl = {
type: LOAD_ACCESS_CONTROL,
payload: action.payload
};
yield put(accessControlAction);
}
}
function* loadPerspectiveDetails(action: LoadPerspectiveDetails) {
const evees: Evees = (yield getContext(ReduxTypes.Context)).get(EveesTypes.Evees);
const details = yield call(() => evees.getPerspectiveDetails(action.payload.perspectiveId));
const successAction: LoadPerspectiveDetailsSuccess = {
type: LOAD_PERSPECTIVE_DETAILS_SUCCESS,
payload: {
perspectiveId: action.payload.perspectiveId,
details
}
};
yield put(successAction);
}
function* filterPerspectiveEntity(action: LoadEntitySuccess) {
const perspectivePattern: PerspectiveEntity = (yield getContext(ReduxTypes.Context)).get(
EveesTypes.PerspectivePattern
);
if (perspectivePattern.recognize(action.payload.entity)) {
const loadPerspectiveDetailsAction: LoadPerspectiveDetails = {
type: LOAD_PERSPECTIVE_DETAILS,
payload: { perspectiveId: action.payload.hash }
};
yield put(loadPerspectiveDetailsAction);
}
}
function* loadAccessControl(action: LoadAccessControl) {
const recognizer: PatternRecognizer = (yield getContext(ReduxTypes.Context)).get(
PatternTypes.Recognizer
);
const updatable: Updatable | undefined = recognizer.recognizeUniqueProperty(
action.payload.entity,
prop => !!(prop as Updatable).update
);
if (updatable) {
const accessControlService: AccessControlService | undefined = updatable.accessControl(
action.payload.entity
);
if (accessControlService) {
const accessControlInformation: any | undefined = yield retry(4, 3000, () =>
accessControlService.getAccessControlInformation(action.payload.hash)