react-native-cross-platform-settings
TypeScript icon, indicating that this package has built-in type declarations

0.1.1 • Public • Published

react-native-cross-platform-settings

Cross-platform implementation of React Native's Settings API

Installation

yarn add react-native-cross-platform-settings

Usage

React Native provides a Settings API, acting as a persistent key–value data store with synchronous reads: https://reactnative.dev/docs/settings

However, the Settings API is only available to iOS applications. This package adds Android support, wrapping Android's SharedPreferences for storage.

import { Settings } from 'react-native-cross-platform-settings';

Settings.set({ name: 'Aaron' });
Settings.get('name')
// 'Aaron'

Note that the watchKeys and clearWatch functions are not supported on Android.

Contributing

See the contributing guide to learn how to contribute to the repository and the development workflow.

License

MIT


Made with create-react-native-library

Package Sidebar

Install

npm i react-native-cross-platform-settings

Weekly Downloads

15

Version

0.1.1

License

MIT

Unpacked Size

22.7 kB

Total Files

24

Last publish

Collaborators

  • alipman88