cycle-native-asyncstorage

A Cycle.js Driver for using AsyncStorage from React Native

Usage no npm install needed!

<script type="module">
  import cycleNativeAsyncstorage from 'https://cdn.skypack.dev/cycle-native-asyncstorage';
</script>

README

Cycle Native AsyncStorage

A Cycle.js Driver for using the AsyncStorage from React Native

npm install cycle-native-asyncstorage

Usage

Sink

Stream of command objects, either one of these:

{
  type: 'clear';
}
{
  type: 'setItem';
  key: string;
  value: string;
}
{
  type: 'mergeItem';
  key: string;
  value: string;
}
{
  type: 'removeItem';
  key: string;
}
{
  type: 'multiSet';
  keyValuePairs: Array<[string, string]>;
}
{
  type: 'multiMerge';
  keyValuePairs: Array<[string, string]>;
}
{
  type: 'multiRemove';
  keys: Array<string>;
};

Source

An object with these methods:

{
  getAllKeys(): Stream<Array<string>>;
  getItem(key: string): Stream<string>;
  multiGet(keys: Array<string>): Stream<Array<[string, string]>>;
}

License

Copyright (C) 2018 Andre 'Staltz' Medeiros, licensed under MIT license