(defaultValue = {} as State)
| 1135 | } |
| 1136 | |
| 1137 | async useState<State extends Dictionary = Dictionary>(defaultValue = {} as State): Promise<State> { |
| 1138 | const kvs = await KeyValueStore.open(null, { config: this.config }); |
| 1139 | return kvs.getAutoSavedValue<State>(BasicCrawler.CRAWLEE_STATE_KEY, defaultValue); |
| 1140 | } |
| 1141 | |
| 1142 | protected get pendingRequestCountApproximation(): number { |
| 1143 | return this.requestManager?.getPendingCount() ?? 0; |