When I tried to integrate pulse framework into an example react-native project I get an error that the storage is missing. This is misleading with the documentation from the README.md Local storage is the default and you don't need to define a storage object for it to work.
.
The pulse setup works without defining a new storage.
You have to define a simple storage object to make it work, otherwise you get the following error:
this._global.storage.get is not a function. ‘(In this._global_storage.get(‘_’)’, ‘this._global.storage.get’ is undefined)
initStorage - Collection.js:132:33
To fix the error you have to define a storage with those functions when creating the library.
pulse = new Pulse.Library({
storage: {
async: true,
store: {},
get: function(key) {
return this.store[key];
},
set: function(key, value) {
this.store[key] = value.toString();
},
clear: function() {
this.store = {};
},
remove: function(key) {
delete this.store[key];
}
},
collections: {
channels: {},
posts: {}
}
});