react-native-onyx 1.0.10 → 1.0.11
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/dist/web.development.js +2 -1
- package/dist/web.development.js.map +1 -1
- package/dist/web.min.js +1 -1
- package/dist/web.min.js.map +1 -1
- package/lib/Onyx.js +2 -1
- package/package.json +1 -1
package/dist/web.development.js
CHANGED
|
@@ -882,6 +882,7 @@ function sendDataToConnection(config, val, key) {
|
|
|
882
882
|
* This is used by any non-React code to connect to Onyx
|
|
883
883
|
* @param {Boolean} [mapping.initWithStoredValues] If set to false, then no data will be prefilled into the
|
|
884
884
|
* component
|
|
885
|
+
* @param {Boolean} [mapping.waitForCollectionCallback] If set to true, it will trigger the callback once and return all data as a single object
|
|
885
886
|
* @returns {Number} an ID to use when calling disconnect
|
|
886
887
|
*/
|
|
887
888
|
function connect(mapping) {
|
|
@@ -932,7 +933,7 @@ function connect(mapping) {
|
|
|
932
933
|
// to expect a single key or multiple keys in the case of a collection.
|
|
933
934
|
// React components are an exception since we'll want to send their
|
|
934
935
|
// initial data as a single object when using collection keys.
|
|
935
|
-
if (mapping.withOnyxInstance && isCollectionKey(mapping.key)) {
|
|
936
|
+
if (mapping.withOnyxInstance && isCollectionKey(mapping.key) || mapping.waitForCollectionCallback) {
|
|
936
937
|
Promise.all(_underscore.default.map(matchingKeys, function (key) {return get(key);})).
|
|
937
938
|
then(function (values) {return _underscore.default.reduce(values, function (finalObject, value, i) {return (0, _extends4.default)({},
|
|
938
939
|
finalObject, (0, _defineProperty2.default)({},
|