qipp-services-io

IO service for Angular application.

Usage no npm install needed!

<script type="module">
  import qippServicesIo from 'https://cdn.skypack.dev/qipp-services-io';
</script>

README

qipp-services-io Build Status npm version

General

The io service is used as a unique shared interface in order to perform read/write actions, typically like localStorage/cookieStorage.

Install

npm i qipp-services-io

Angular usage

In the config phase of your application

For example, if you want to set the service to be tied to the localStorageService from angular-local-storage:

ioProvider.defaults.provider = 'localStorageService'
ioProvider.defaults.getMethod = 'get'
ioProvider.defaults.setMethod = 'set'
ioProvider.defaults.clearMethod = 'clearAll'

Accessing methods

Then you can perfom the usual I/O operations needed:

io.set('oneProperty', 123)
io.get('oneProperty') // 123
// Clear all values.
io.clear()

Tools

Linting with StandardJS

Please refer to the JavaScript Standard Style for general rules.

npm run lint

Unit testing with Karma

npm test

Requirements

Angular

Qipp modules

Licence

Released under the MIT license by qipp.