1.2.2 • Published 3 years ago

@onehilltech/ember-cli-storage v1.2.2

Weekly downloads
1
License
Apache-2.0
Repository
github
Last release
3 years ago

ember-cli-storage

A simple and easy way to interact with local and session storage.

Compatibility

  • Ember.js v3.12 or above
  • Ember CLI v2.13 or above
  • Node.js v10 or above

Installation

ember install @onehilltech/ember-cli-storage

Usage

The add-on uses decorators to set/get items to/from local or session storage. For local storage, use @local. For session storage, use @session. The parameters for either decorator is the same.

class MyClass {
  @session
  mySessionProperty;
  
  @local
  myLocalProperty;
 
  /////////
  // advanced usage
  /////////

  // store the value under 'aDifferentName'
  @local ('aDifferentName') name;
  @local ({name: 'aDifferentName'}) anotherName;

  // use the serialize/deserialize method to customize storing/retrieving
  @local ({serialize: JSON.stringify, deserialize: JSON.parse}) object;
}

Happy Coding!

Contributing

See the Contributing guide for details.

License

This project is licensed under the Apache 2.0.

1.2.0

3 years ago

1.1.0

3 years ago

1.2.2

3 years ago

1.0.0

4 years ago

0.2.1

7 years ago

0.2.0

7 years ago

0.1.0

7 years ago