1.0.11 • Published 2 years ago

testonomica_api v1.0.11

Weekly downloads
-
License
ISC
Repository
github
Last release
2 years ago

Как использовать

  1. Включение исходников в проект
  2. Подключение внешней собранной библиотеки:

    <script src="https://cdn.jsdelivr.net/gh/davidtema/testonomica_api@1.2.0/build.min.js"></script>

Answers repository

There are two main ways for storing answers: cookie-based and Firebase. Firebase is paid after a little requests limit, therefore cookie-based is preferable. Nevertheless, if you include the library via cross-domain request, cookie don't work because of browsers policy. That's why you may want to use Firebase. Below is the code for both cases, when the library needed to be connected locally or via cross-domain access.

let storage = null;
if (isCookieEnabled()) {
    storage = new ProgressStorage(config.getTestId());
} else {
    /** sid will be generated and saved in the localStorage and used if there is no sid in the tag */
    const sid = tag.getAttribute('data-sid');
    if (!sid) {
        throw Error('Error: sid has to be specified.');
    }
    storage = new ProgressFirebaseStorage(config.getTestId(), sid);
}

Developing

In API package:

yarn link

In your project:

yarn link [package...]
1.0.11

2 years ago

1.0.9

2 years ago

1.0.8

2 years ago

1.0.7

2 years ago

1.0.6

2 years ago

1.0.4

2 years ago

1.0.3

2 years ago

1.0.2

2 years ago

1.0.1

2 years ago

1.0.0

2 years ago