How to use the rx-extensions.ofType function in rx-extensions

To help you get started, we’ve selected a few rx-extensions examples, based on popular ways it is used in public projects.

Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.

github noobaa / noobaa-core / frontend / src / app / epics / run-upgrade-package-tests.js View on Github external
export default function(action$, { api }) {
    return action$.pipe(
        ofType(RUN_UPGRADE_PACKAGE_TESTS),
        mergeMap(async () => {
            await api.upgrade.cluster_pre_upgrade({});
        })
    );
}
github noobaa / noobaa-core / frontend / src / app / epics / react-to-create-account-result.js View on Github external
function _replaceModalAfterSuccess(action$) {
    return action$.pipe(
        ofType(COMPLETE_CREATE_ACCOUNT),
        mergeMap(action => {
            const { accountName, password } = action.payload;
            return action$.pipe(
                ofType(COMPLETE_FETCH_SYSTEM_INFO),
                take(1),
                map(() => replaceWithAccountCreatedModal(accountName, password))
            );
        })
    );
}
github noobaa / noobaa-core / frontend / src / app / epics / reload-after-system-upgrade.js View on Github external
export default function(action$, { browser }) {
    return action$.pipe(
        ofType(COMPLETE_UPGRADE_SYSTEM),
        map(action => {
            const { system, version } = action.payload;
            const url = realizeUri(routes.system, { system }, { afterupgrade: version });
            browser.reload(url);
        })
    );
}
github noobaa / noobaa-core / frontend / src / app / epics / leave-maintenance-mode.js View on Github external
export default function(action$, { api }) {
    return action$.pipe(
        ofType(LEAVE_MAINTENANCE_MODE),
        mergeMap(async () => {
            try {
                await api.system.set_maintenance_mode({ duration : 0 });

                return completeLeaveMaintenanceMode();
            } catch (error) {
                return failLeaveMaintenanceMode(
                    mapErrorObject(error)
                );
            }
        })
    );
}
github noobaa / noobaa-core / frontend / src / app / epics / close-create-account-on-faliure.js View on Github external
export default function(action$) {
    return action$.pipe(
        ofType(FAIL_CREATE_ACCOUNT),
        map(() => closeModal())
    );
}

rx-extensions

Library for useful RxJS extensions and operators

ISC
Latest version published 4 years ago

Package Health Score

42 / 100
Full package analysis

Popular rx-extensions functions