Skip to content
This repository has been archived by the owner on Aug 9, 2024. It is now read-only.

RFC: $kv.fill #27

Open
Kelin2025 opened this issue Jul 7, 2023 · 3 comments
Open

RFC: $kv.fill #27

Kelin2025 opened this issue Jul 7, 2023 · 3 comments
Assignees
Labels
enhancement New feature or request

Comments

@Kelin2025
Copy link
Member

Case

Sometimes you need to fill KV with values. Not .clear, not .addItems

Solution

$kv.fill([{ key: 'foo', value: ...}, { key: 'foo2', value: ... }])
@Kelin2025 Kelin2025 added the enhancement New feature or request label Jul 7, 2023
@Kelin2025 Kelin2025 self-assigned this Jul 7, 2023
@Minhir
Copy link
Member

Minhir commented Jul 8, 2023

Can you elaborate a little bit on this? What's the difference with .addItems? Does it accept partials and only applies changes if items are already in kv?

@Kelin2025
Copy link
Member Author

@Minhir it removes the previously added items. It's .clear + .addItems but in one tick

@Minhir
Copy link
Member

Minhir commented Jul 10, 2023

Maybe refill can be a better name.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

2 participants