Demo for query storing
Change-Id: I947bcac841992c3f6cfd01ab337c265b0d01cb70
diff --git a/node_modules/import-lazy/index.js b/node_modules/import-lazy/index.js
new file mode 100644
index 0000000..9d3e288
--- /dev/null
+++ b/node_modules/import-lazy/index.js
@@ -0,0 +1,26 @@
+'use strict';
+const lazy = (mod, fn, id) => mod === undefined ? fn(id) : mod;
+
+module.exports = fn => {
+ return id => {
+ let mod;
+
+ const handler = {
+ get: (target, property) => {
+ mod = lazy(mod, fn, id);
+ return Reflect.get(mod, property);
+ },
+ apply: (target, thisArg, argumentsList) => {
+ mod = lazy(mod, fn, id);
+ return Reflect.apply(mod, thisArg, argumentsList);
+ },
+ construct: (target, argumentsList) => {
+ mod = lazy(mod, fn, id);
+ return Reflect.construct(mod, argumentsList);
+ }
+ };
+
+ // eslint-disable-next-line prefer-arrow-callback
+ return new Proxy(function () {}, handler);
+ };
+};