Skip to content

[plugin-store]: add function to set/get whole store #2386

Open
@sakgoyal

Description

@sakgoyal

currently I am only able to get/set a value in a store individually. is there a way to add a function to get/set all of them at the same time? I need to read many keys at the same time and making 10 different get calls is very inconvenient.

any chance that can be added? maybe something like:

import { load } from "@tauri-apps/plugin-store";
const store = await load(...);

//current:
store.set(key, val); // set individually
store.set(key, val);
store.set(key, val);
store.set(key, val);

// proposed
await store.set({
  key1: val1,
  key2: val2,
  // ...
}); 

This can be done by overloading by passing an object (passing 2 params means setting indiviually will stay the same)

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions