3.2.0 • Published 2 years ago

cycle-native-asyncstorage v3.2.0

Weekly downloads
2
License
MIT
Repository
gitlab
Last release
2 years ago

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