UNPKG

2.14 kBSource Map (JSON)View Raw
1{"version":3,"file":"networkStatus.js","sourceRoot":"","sources":["../../src/core/networkStatus.ts"],"names":[],"mappings":"AAGA,MAAM,CAAN,IAAY,aA0CX;AA1CD,WAAY,aAAa;IAMvB,uDAAW,CAAA;IAMX,iEAAgB,CAAA;IAMhB,2DAAa,CAAA;IAMb,uDAAW,CAAA;IAOX,iDAAQ,CAAA;IAKR,mDAAS,CAAA;IAKT,mDAAS,CAAA;AACX,CAAC,EA1CW,aAAa,KAAb,aAAa,QA0CxB;AAMD,MAAM,UAAU,wBAAwB,CACtC,aAA6B;IAE7B,OAAO,aAAa,CAAC,CAAC,CAAC,aAAa,GAAG,CAAC,CAAC,CAAC,CAAC,KAAK,CAAC;AACnD,CAAC","sourcesContent":["/**\n * The current status of a query’s execution in our system.\n */\nexport enum NetworkStatus {\n /**\n * The query has never been run before and the query is now currently running. A query will still\n * have this network status even if a partial data result was returned from the cache, but a\n * query was dispatched anyway.\n */\n loading = 1,\n\n /**\n * If `setVariables` was called and a query was fired because of that then the network status\n * will be `setVariables` until the result of that query comes back.\n */\n setVariables = 2,\n\n /**\n * Indicates that `fetchMore` was called on this query and that the query created is currently in\n * flight.\n */\n fetchMore = 3,\n\n /**\n * Similar to the `setVariables` network status. It means that `refetch` was called on a query\n * and the refetch request is currently in flight.\n */\n refetch = 4,\n\n /**\n * Indicates that a polling query is currently in flight. So for example if you are polling a\n * query every 10 seconds then the network status will switch to `poll` every 10 seconds whenever\n * a poll request has been sent but not resolved.\n */\n poll = 6,\n\n /**\n * No request is in flight for this query, and no errors happened. Everything is OK.\n */\n ready = 7,\n\n /**\n * No request is in flight for this query, but one or more errors were detected.\n */\n error = 8,\n}\n\n/**\n * Returns true if there is currently a network request in flight according to a given network\n * status.\n */\nexport function isNetworkRequestInFlight(\n networkStatus?: NetworkStatus,\n): boolean {\n return networkStatus ? networkStatus < 7 : false;\n}\n"]}
\No newline at end of file