How to use rx-extensions - 10 common examples

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())
    );
}
github noobaa / noobaa-core / frontend / src / app / components / modals / add-bucket-trigger-modal / add-bucket-trigger-modal.js View on Github external
constructor({ bucketName }) {
        super();

        this.bucketName = ko.unwrap(bucketName);

        this.observe(
            state$.pipe(
                getMany(
                    ['buckets', this.bucketName, 'triggers'],
                    'functions',
                    'accounts'
                )
            ),
            this.onState
        );
    }
github noobaa / noobaa-core / frontend / src / app / components / application / main-layout / main-layout.js View on Github external
this.breadcrumbs = ko.observableArray();
        this.area = ko.observable();
        this.panel = ko.observable();
        this.isUploadButtonVisible = ko.observable(false);

        this.observe(
            state$.pipe(getMany(
                'location',
                'session'
            )),
            this.onLocation
        );

        this.observe(
            state$.pipe(
                getMany(
                    'accounts',
                    ['session', 'user']
                )
            ),
            this.onAccount
        );

        registerForAlerts();
    }
github noobaa / noobaa-core / frontend / src / app / components / bucket / bucket-objects-table / bucket-objects-table.js View on Github external
constructor({ bucketName }) {
        super();

        this.bucketName = ko.unwrap(bucketName);

        this.observe(
            state$.pipe(get('location')),
            this.onLocation
        );
        this.observe(
            state$.pipe(
                getMany(
                    ['buckets', this.bucketName],
                    'objects',
                    ['session', 'user'],
                    ['accounts'],
                    ['system', 'sslCert', 'installed']
                )
            ),
            this.onState
        );
    }
github noobaa / noobaa-core / frontend / src / app / components / modals / upgrade-system-modal / upgrade-system-modal.js View on Github external
label: 'New Version',
                value: this.stagedVersion
            },
            {
                label: 'Validated at',
                value: this.testedAt
            },
            {
                label: 'Validation Result',
                value: 'Successful'
            }
        ];

        this.observe(
            state$.pipe(
                getMany(
                    ['location', 'params', 'system'],
                    'system',
                    ['topology', 'servers']
                )
            ),
            this.onState
        );
    }
github noobaa / noobaa-core / frontend / src / app / components / bucket / bucket-summary / bucket-summary.js View on Github external
constructor({ bucketName }) {
        super();

        this.observe(
            state$.pipe(
                getMany(
                    ['buckets', ko.unwrap(bucketName)],
                    'hostPools'
                )
            ),
            this.onState
        );
    }

rx-extensions

Library for useful RxJS extensions and operators

ISC
Latest version published 5 years ago

Package Health Score

42 / 100
Full package analysis

Popular rx-extensions functions