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

1.0.0-beta.4 • Public • Published

@thorgate/spa-is

Internal type checking library for SPA packages used by Thorgate project template SPA variant

Available object type checks:

  • isRouteSagaObject(obj)
  • isIterable(obj)
  • isIterator(obj)
  • isPromise(obj)

Avalable utility checks:

  • isNode() - true if running on node, false if running in browser

Usage:

import { isNode } from '@thorgate/spa-is';

let history;
if (isNode()) {
    history = createMemoryHistory();
} else {
    history = createBrowserHistory();
}

Readme

Keywords

none

Package Sidebar

Install

npm i @thorgate/spa-is

Weekly Downloads

506

Version

1.0.0-beta.4

License

MIT

Unpacked Size

7.6 kB

Total Files

6

Last publish

Collaborators

  • thorgate-main
  • jyrno42
  • metsavaht