Initial commit
This commit is contained in:
commit
78f8d225ee
21173 changed files with 2907774 additions and 0 deletions
35
node_modules/next/dist/server/web/spec-extension/unstable-no-store.js
generated
vendored
Normal file
35
node_modules/next/dist/server/web/spec-extension/unstable-no-store.js
generated
vendored
Normal file
|
|
@ -0,0 +1,35 @@
|
|||
"use strict";
|
||||
Object.defineProperty(exports, "__esModule", {
|
||||
value: true
|
||||
});
|
||||
Object.defineProperty(exports, "unstable_noStore", {
|
||||
enumerable: true,
|
||||
get: function() {
|
||||
return unstable_noStore;
|
||||
}
|
||||
});
|
||||
const _workasyncstorageexternal = require("../../app-render/work-async-storage.external");
|
||||
const _workunitasyncstorageexternal = require("../../app-render/work-unit-async-storage.external");
|
||||
const _dynamicrendering = require("../../app-render/dynamic-rendering");
|
||||
function unstable_noStore() {
|
||||
const callingExpression = 'unstable_noStore()';
|
||||
const store = _workasyncstorageexternal.workAsyncStorage.getStore();
|
||||
const workUnitStore = _workunitasyncstorageexternal.workUnitAsyncStorage.getStore();
|
||||
if (!store) {
|
||||
// This generally implies we are being called in Pages router. We should probably not support
|
||||
// unstable_noStore in contexts outside of `react-server` condition but since we historically
|
||||
// have not errored here previously, we maintain that behavior for now.
|
||||
return;
|
||||
} else if (store.forceStatic) {
|
||||
return;
|
||||
} else {
|
||||
store.isUnstableNoStore = true;
|
||||
if (workUnitStore && workUnitStore.type === 'prerender') {
|
||||
// unstable_noStore() is a noop in Dynamic I/O.
|
||||
} else {
|
||||
(0, _dynamicrendering.markCurrentScopeAsDynamic)(store, workUnitStore, callingExpression);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
//# sourceMappingURL=unstable-no-store.js.map
|
||||
Loading…
Add table
Add a link
Reference in a new issue