@just-web/preferences
TypeScript icon, indicating that this package has built-in type declarations

7.2.6 • Public • Published

@just-web/preferences

NPM version NPM downloads

@just-web/preferences plugin defines the interface of get and set user preferences.

Where the preferences are saved depends on how it is implemented in the details.

This package provides a memoryPreferencesGizmo that stores preferences in memory. But in practice, most likely you should use a different implementation such as:

  • @just-web/browser-preferences: Save preference in browser local storage.
  • 🚧 @just-web/service-preferences: Save preference in a remote service.

Install

# npm
npm install @just-web/preferences

# yarn
yarn add @just-web/preferences

# pnpm
pnpm install @just-web/preferences

#rush
rush add -p @just-web/preferences

Usage

Here is how to use memoryPreferencesGizmo:

import { justApp } from '@just-web/app'
import { commandsGizmoFn } from '@just-web/commands'
import { keyboardGizmoFn } from '@just-web/keyboard' // optional
import { memoryPreferencesGizmo } from '@just-web/preferences'

const app = await justApp({ name: 'your-app' })
  .with(commandsGizmoFn())
  .with(keyboardGizmoFn())
  .with(memoryPreferencesGizmo)
  .create()

Readme

Keywords

Package Sidebar

Install

npm i @just-web/preferences

Weekly Downloads

1

Version

7.2.6

License

MIT

Unpacked Size

53.3 kB

Total Files

61

Last publish

Collaborators

  • unional