{"ScriptPreparationCode":null,"TestCases":[{"Name":"Class","Code":"class WaitingState {\r\n _loaders = []\r\n\r\n get loaders() {\r\n return this._loaders\r\n }\r\n\r\n stop(loaderId) {\r\n this._loaders.splice(this._loaders.indexOf(loaderId), 1)\r\n }\r\n\r\n start(loaderId) {\r\n if (!this._loaders.includes(loaderId)) {\r\n this._loaders.push(loaderId)\r\n }\r\n return () =\u003E this.stop(loaderId)\r\n }\r\n\r\n isLoading(loaderId) {\r\n return this._loaders.includes(loaderId)\r\n }\r\n};\r\n\r\nconst $wait = new WaitingState();\r\nconsole.log($wait.isLoading(\u0027plop\u0027))\r\n$wait.start(\u0027plop\u0027);\r\nconsole.log($wait.isLoading(\u0027plop\u0027))\r\n$wait.stop(\u0027plop\u0027);\r\nconsole.log($wait.isLoading(\u0027plop\u0027))","IsDeferred":false},{"Name":"Object","Code":"const waitState = [];\r\nconst $wait = {\r\n start: (id) =\u003E {\r\n if (!waitState.includes(id)) {\r\n waitState.push(id)\r\n }\r\n return () =\u003E waitInstance.stop(id)\r\n },\r\n stop: (id) =\u003E {\r\n if (waitState.includes(id)) {\r\n waitState.splice(waitState.indexOf(id), 1)\r\n }\r\n },\r\n isLoading: (id) =\u003E {\r\n return waitState.includes(id)\r\n },\r\n}\r\n\r\nconsole.log($wait.isLoading(\u0027plop\u0027))\r\n$wait.start(\u0027plop\u0027);\r\nconsole.log($wait.isLoading(\u0027plop\u0027))\r\n$wait.stop(\u0027plop\u0027);\r\nconsole.log($wait.isLoading(\u0027plop\u0027))","IsDeferred":false}]}