@base-ui/react
Version:
Base UI is a library of headless ('unstyled') React components and low-level hooks. You gain complete control over your app's CSS and accessibility features.
23 lines (22 loc) • 841 B
JavaScript
;
Object.defineProperty(exports, "__esModule", {
value: true
});
exports.NullStore = void 0;
var _store = require("@base-ui/utils/store");
/**
* A `ReactStore` whose state never changes.
*
* Useful for fallback stores that need to support normal store reads while detached from the
* component that owns real state. Context values may still contain mutable refs or maps.
*/
class NullStore extends _store.ReactStore {
// `update`/`set`/`notifyAll` funnel through `setState` in the base `Store`, so overriding
// `setState` alone would neutralize them today. They are overridden explicitly so the store stays
// inert even if a future base-class change stops routing a mutator through `setState`.
setState(_newState) {}
update(_changes) {}
set(_key, _value) {}
notifyAll() {}
}
exports.NullStore = NullStore;