MCPcopy Create free account
hub / github.com/Snapchat/Valdi / remove

Method remove

valdi/src/valdi/runtime/JavaScript/Modules/PersistentStore.cpp:132–140  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

130}
131
132void PersistentStore::remove(const StringBox& key, Function<void(Result<Void>)> completion) {
133 _dispatchQueue->async([key, self = strongRef(this), completion = std::move(completion)]() {
134 if (self->_store.remove(key)) {
135 self->scheduleSave(completion);
136 } else {
137 completion(Error(STRING_FORMAT("Did not find item '{}'", key)));
138 }
139 });
140}
141
142void PersistentStore::removeAll(Function<void(Result<Void>)> completion) {
143 _dispatchQueue->async([self = strongRef(this), completion = std::move(completion)]() {

Callers

nothing calls this directly

Calls 5

scheduleSaveMethod · 0.95
strongRefFunction · 0.85
removeMethod · 0.65
ErrorInterface · 0.50
asyncMethod · 0.45

Tested by

no test coverage detected