Closed retyui closed 4 years ago
Thanks for reporting the issue. Please open a PR with a suggested solution.
Stale issue message
ignore
@robwalkerco Thank for good issue solving (sarcasm)
When I write ignore
I mean that the bot shouldn't close it
Ah, understood.
@retyui Just looked into this.
The default toFileName
and fromFileName
functions at https://github.com/robwalkerco/redux-persist-filesystem-storage/blob/master/index.js#L28-L29 convert :
to -
and back again.
If you want to use those characters in your keys, then you may want to provide your own functions like
import FilesystemStorage from 'redux-persist-filesystem-storage'
...
FilesystemStorage.config({
storagePath: `${RNFetchBlob.fs.dirs.DocumentDir}/persistStore`,
toFileName: (name: string) => name.split(":").join("_"),
fromFileName: (name: string) => name.split("_").join(":"),
});
const persistConfig = {
key: 'root',
storage: FilesystemStorage,
}
...
I have also updated the readme to show all the configurable options and their default values - f21e0e608665a4853d10850e154d265b5bbd1e4d
As you see above I expected that
getAllKeys
returns[..., 'a:my-super-key']
instead of[a:my:super:key]