Home

Awesome

Build status Build Status npm version

tiny-ng-store

A flexible store for Angular 2 projects. A tiny API and small footprint allow for a quick setup.

Docs

Use

Initialize

In your main app module

import { TinyNgStore } from 'tiny-ng-store/tiny-ng-store';

@NGModule({
    ...
    providers: [ TinyNgStore ]
    ...
})

Inject

import { TinyNgStore, StoreItem, TnsState } from 'tiny-ng-store/tiny-ng-store';

items: TnsState<any>;
constructor(private storeService: TinyNgStore) {};

Get Item

this.storeService.GetItem('storeName')

Insert Item

this.storeService.InsertItem({ name: 'storeName' data: 'Any Data' });

Update Item

this.storeService.UpdateItem({ name: 'storeName' data: 'Updated Data' });

Remove Item

this.storeService.DeleteItem('storeName');

Run tests

npm install
npm run tests

Examples

Versions

3.0.1

3.0.0

Breaking:

Non-Breaking:

2.0.0

Breaking: