// packages/preferences/src/store/actions.ts
function toggle(scope, name) {
  return function({ select, dispatch }) {
    const currentValue = select.get(scope, name);
    dispatch.set(scope, name, !currentValue);
  };
}
function set(scope, name, value) {
  return {
    type: "SET_PREFERENCE_VALUE",
    scope,
    name,
    value
  };
}
function setDefaults(scope, defaults) {
  return {
    type: "SET_PREFERENCE_DEFAULTS",
    scope,
    defaults
  };
}
async function setPersistenceLayer(persistenceLayer) {
  const persistedData = await persistenceLayer.get();
  return {
    type: "SET_PERSISTENCE_LAYER",
    persistenceLayer,
    persistedData
  };
}
export {
  set,
  setDefaults,
  setPersistenceLayer,
  toggle
};
//# sourceMappingURL=actions.mjs.map
