@thorgate/spa-pending-data
TypeScript icon, indicating that this package has built-in type declarations

1.0.0-beta.4 • Public • Published

@thorgate/spa-pending-data

Pending data manager used by Thorgate project template SPA variant

view-manager package uses @thorgate/spa-pending-data to store current loading status of the app in Redux state.

Usage:

Some where in your app:

import { isViewLoading, loadingActions } from '@thorgate/spa-pending-data';
import { getLocation } from 'connected-react-router';
import { select, take } from 'redux-saga/effects';

export function* waitLoadingDone() {
    const location = yield select(getLocation);
    const loadedView = yield select(getLoadedView);

    if (loadedView === location.key) {
        return;
    }

    yield take(loadingActions.setLoadedView.getType());
}

PendingDataManager is designed to show previous location until loadingActions.setLoadedView is set to currently active location in react-router context.

Dependencies (4)

Dev Dependencies (0)

    Package Sidebar

    Install

    npm i @thorgate/spa-pending-data

    Weekly Downloads

    211

    Version

    1.0.0-beta.4

    License

    MIT

    Unpacked Size

    18.3 kB

    Total Files

    11

    Last publish

    Collaborators

    • thorgate-main
    • jyrno42
    • metsavaht