react-native-mmkv 4.0.0-beta.11 → 4.0.0-beta.12
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/NitroMmkv.podspec +1 -1
- package/cpp/HybridMMKV.cpp +13 -2
- package/package.json +1 -1
package/NitroMmkv.podspec
CHANGED
|
@@ -25,7 +25,7 @@ Pod::Spec.new do |s|
|
|
|
25
25
|
# Add MMKV Core dependency
|
|
26
26
|
s.compiler_flags = '-x objective-c++'
|
|
27
27
|
s.libraries = 'z', 'c++'
|
|
28
|
-
s.dependency 'MMKVCore', '
|
|
28
|
+
s.dependency 'MMKVCore', '2.2.4'
|
|
29
29
|
|
|
30
30
|
# TODO: Remove when no one uses RN 0.79 anymore
|
|
31
31
|
# Add support for React Native 0.79 or below
|
package/cpp/HybridMMKV.cpp
CHANGED
|
@@ -72,9 +72,20 @@ overloaded(Ts...) -> overloaded<Ts...>;
|
|
|
72
72
|
|
|
73
73
|
void HybridMMKV::set(const std::string& key, const std::variant<std::string, double, bool, std::shared_ptr<ArrayBuffer>>& value) {
|
|
74
74
|
// Pattern-match each potential value in std::variant
|
|
75
|
-
std::visit(overloaded{[&](const std::string& string) {
|
|
76
|
-
|
|
75
|
+
std::visit(overloaded{[&](const std::string& string) {
|
|
76
|
+
// string
|
|
77
|
+
instance->set(string, key);
|
|
78
|
+
},
|
|
79
|
+
[&](double number) {
|
|
80
|
+
// number
|
|
81
|
+
instance->set(number, key);
|
|
82
|
+
},
|
|
83
|
+
[&](bool b) {
|
|
84
|
+
// boolean
|
|
85
|
+
instance->set(b, key);
|
|
86
|
+
},
|
|
77
87
|
[&](const std::shared_ptr<ArrayBuffer>& buf) {
|
|
88
|
+
// ArrayBuffer
|
|
78
89
|
MMBuffer buffer(buf->data(), buf->size(), MMBufferCopyFlag::MMBufferNoCopy);
|
|
79
90
|
instance->set(std::move(buffer), key);
|
|
80
91
|
}},
|