How to use the san-store.store.getState function in san-store

To help you get started, we’ve selected a few san-store 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 ecomfe / san-realworld-app / test / unit / common / action.spec.js View on Github external
it('set errors and clear errors', () => {
    store.dispatch(Types.ERRORS_SET, {title: 'one'});

    let errors = store.getState('errors');
    expect(errors.length).toBe(1);
    expect(errors[0]).toBe('title one');

    store.dispatch(Types.ERRORS_CLEAR);
    expect(store.getState('errors') == null).toBeTruthy();
  });
});
github ecomfe / san-realworld-app / test / unit / article / action.spec.js View on Github external
it('fetch list', done => {
    let fetchPromise = store.dispatch(Types.FETCH);

    expect(store.getState('articlesLoading')).toBeTruthy();

    fetchPromise.then(() => {
        expect(store.getState('articlesLoading')).toBeFalsy();
        expect(store.getState('articleCount')).toBe(500);
        expect(store.getState('articlePageCount') >= store.getState('articleCount') / Conf.PAGE_SIZE).toBeTruthy();
        expect(store.getState('articles') instanceof Array).toBeTruthy();

        done();
    });


  });
});
github ecomfe / san-realworld-app / test / unit / common / action.spec.js View on Github external
it('set errors and clear errors', () => {
    store.dispatch(Types.ERRORS_SET, {title: 'one'});

    let errors = store.getState('errors');
    expect(errors.length).toBe(1);
    expect(errors[0]).toBe('title one');

    store.dispatch(Types.ERRORS_CLEAR);
    expect(store.getState('errors') == null).toBeTruthy();
  });
});
github ecomfe / san-realworld-app / test / unit / article / action.spec.js View on Github external
fetchPromise.then(() => {
        expect(store.getState('articlesLoading')).toBeFalsy();
        expect(store.getState('articleCount')).toBe(500);
        expect(store.getState('articlePageCount') >= store.getState('articleCount') / Conf.PAGE_SIZE).toBeTruthy();
        expect(store.getState('articles') instanceof Array).toBeTruthy();

        done();
    });
github ecomfe / san-realworld-app / test / unit / article / action.spec.js View on Github external
fetchPromise.then(() => {
        expect(store.getState('articlesLoading')).toBeFalsy();
        expect(store.getState('articleCount')).toBe(500);
        expect(store.getState('articlePageCount') >= store.getState('articleCount') / Conf.PAGE_SIZE).toBeTruthy();
        expect(store.getState('articles') instanceof Array).toBeTruthy();

        done();
    });
github ecomfe / san-realworld-app / test / unit / article / action.spec.js View on Github external
fetchPromise.then(() => {
        expect(store.getState('articlesLoading')).toBeFalsy();
        expect(store.getState('articleCount')).toBe(500);
        expect(store.getState('articlePageCount') >= store.getState('articleCount') / Conf.PAGE_SIZE).toBeTruthy();
        expect(store.getState('articles') instanceof Array).toBeTruthy();

        done();
    });

san-store

Application State Management for San

MIT
Latest version published 17 days ago

Package Health Score

79 / 100
Full package analysis