From 9ecab4d5b2af6c984eacd4f7471a136b7cdea5ec Mon Sep 17 00:00:00 2001 From: Ahmet Yesil Date: Tue, 4 Aug 2020 13:42:20 +0200 Subject: [PATCH] chore: remove LionSingleton --- .changeset/silver-rice-applaud.md | 9 ++ packages/ajax/README.md | 8 +- packages/ajax/src/AjaxClass.js | 5 +- packages/ajax/src/ajax.js | 2 +- .../ajax/test/AjaxClass.interceptors.test.js | 20 +-- packages/ajax/test/AjaxClass.test.js | 46 ++++--- .../ajax/test/AjaxClass.transformers.test.js | 20 +-- packages/core/index.js | 1 - packages/core/src/LionSingleton.js | 51 ------- packages/core/test/LionSingleton.test.js | 126 ------------------ packages/icon/src/IconManager.js | 8 +- packages/icon/src/icons.js | 2 +- packages/localize/src/LocalizeManager.js | 4 +- packages/localize/src/localize.js | 2 +- .../localize/test/LocalizeManager.test.js | 3 +- packages/localize/test/localize.test.js | 6 - 16 files changed, 70 insertions(+), 243 deletions(-) create mode 100644 .changeset/silver-rice-applaud.md delete mode 100644 packages/core/src/LionSingleton.js delete mode 100644 packages/core/test/LionSingleton.test.js diff --git a/.changeset/silver-rice-applaud.md b/.changeset/silver-rice-applaud.md new file mode 100644 index 000000000..2ed7870cd --- /dev/null +++ b/.changeset/silver-rice-applaud.md @@ -0,0 +1,9 @@ +--- +'@lion/ajax': minor +'@lion/core': minor +'@lion/icon': minor +'@lion/localize': minor +--- + +Removing LionSingleton as es modules are already guaranteed to be singletons. +This reduces complexity and means less code to ship to our users. diff --git a/packages/ajax/README.md b/packages/ajax/README.md index 2cfd3b6f3..20d73b7e4 100644 --- a/packages/ajax/README.md +++ b/packages/ajax/README.md @@ -91,7 +91,7 @@ This prefix should be stripped before parsing the string as JSON. Pass the prefix with the `jsonPrefix` option. ```js -const myAjax = AjaxClass.getNewInstance({ jsonPrefix: ")]}'," }); +const myAjax = new AjaxClass({ jsonPrefix: ")]}'," }); myAjax .get('./packages/ajax/docs/assets/data.json') .then(response => { @@ -110,7 +110,7 @@ Add additional headers to the requests with the `headers` option. export const additionalHeaders = () => html`