https://github.com/ddfreiling/nativescript-appsettings-async
Async version of Nativescript's Application-Settings module
https://github.com/ddfreiling/nativescript-appsettings-async
Last synced: 12 months ago
JSON representation
Async version of Nativescript's Application-Settings module
- Host: GitHub
- URL: https://github.com/ddfreiling/nativescript-appsettings-async
- Owner: ddfreiling
- License: apache-2.0
- Created: 2017-09-05T13:39:27.000Z (almost 9 years ago)
- Default Branch: master
- Last Pushed: 2018-01-26T11:18:48.000Z (over 8 years ago)
- Last Synced: 2025-06-17T06:04:32.938Z (12 months ago)
- Language: TypeScript
- Size: 1.94 MB
- Stars: 1
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# Deprecated
This approach is now integrated with tns-core-modules >= 3.4.0, making this plugin deprecated.
# AppSettings Async
nativescript-appsettings-async does everything that tns-core-modules/application-settings does, but it does so without block the UI thread whenever writing a new value.
The way Nativescript by default synchronously flushes all settings to disk whenever a single value is changed, seemed very detrimental to a smooth UI experience, so I implemented this plugin to fix that. This change will primarily be felt when writing many or very large string to application-settings.
## Installation
```
tns plugin add @nota/nativescript-appsettings-async
```
## Usage
```javascript
import { AppSettingsAsync as appSettingsAsync } from '@nota/nativescript-appsettings-async';
// Same interface as default application-settings, but Async setters
appSettingsAsync.setString('my_key', 'my_value');
// Explicitly flush settings to persistant storage.
appSettingsAsync.flush();
```
## TODO
- Load app-settings on a background thread
## License
Apache License Version 2.0, January 2004