1
- <img src =" https://raw.githubusercontent.com/js-data/js-data/master/js-data.png " alt =" js-data logo " title =" js-data " align =" right " width =" 64 " height =" 64 " />
1
+ <img src =" https://raw.githubusercontent.com/js-data/js-data/master/js-data.png " alt =" js-data logo " title =" js-data " align =" right " width =" 96 " height =" 96 " />
2
2
3
- ## js-data-localstorage [ ![ Slack Status] [ sl_b ]] [ sl_l ] [ ![ npm version] [ npm_b ]] [ npm_l ] [ ![ Circle CI] [ circle_b ]] [ circle_l ] [ ![ npm downloads] [ dn_b ]] [ dn_l ] [ ![ Coverage Status] [ cov_b ]] [ cov_l ] [ ![ Codacy] [ cod_b ]] [ cod_l ]
3
+ # js-data-localstorage
4
+
5
+ [ ![ Slack Status] [ sl_b ]] [ sl_l ]
6
+ [ ![ npm version] [ npm_b ]] [ npm_l ]
7
+ [ ![ Circle CI] [ circle_b ]] [ circle_l ]
8
+ [ ![ npm downloads] [ dn_b ]] [ dn_l ]
9
+ [ ![ Coverage Status] [ cov_b ]] [ cov_l ]
10
+ [ ![ Codacy] [ cod_b ]] [ cod_l ]
4
11
5
12
localStorage adapter for [ js-data] ( http://www.js-data.io/ ) .
6
13
7
14
Tested on IE9, Chrome 46, Firefox 41 & Safari 7.1 using
8
15
<img src =" https://raw.githubusercontent.com/js-data/js-data-localstorage/master/bs.jpg " alt =" bs logo " title =" browserstack " width =" 150 " height =" 35 " style =" vertical-align : middle " />
9
16
10
- ### API Documentation
11
- [ DSLocalStorageAdapter] ( http://www.js-data.io/docs/dslocalstorageadapter )
17
+ ## Table of contents
12
18
13
- ### Demo
14
- [ https://js-data-localstorage.firebaseapp.com/ ] ( https://js-data-localstorage.firebaseapp.com/ )
19
+ * [ Quick start] ( #quick-start )
20
+ * [ Documentation] ( #documentation )
21
+ * [ API Reference] ( #api-reference )
22
+ * [ Demo] ( #demo )
23
+ * [ Support] ( #support )
24
+ * [ Community] ( #community )
25
+ * [ Contributing] ( #contributing )
26
+ * [ License] ( #license )
27
+
28
+ ## Quick Start
15
29
16
- ### Quick Start
17
30
` npm install --save js-data js-data-localstorage ` or ` bower install --save js-data js-data-localstorage ` .
18
31
19
32
Load ` js-data-localstorage.js ` after ` js-data.js ` .
20
33
21
34
``` js
22
- var adapter = new DSLocalStorageAdapter ();
35
+ var adapter = new LocalStorageAdapter ();
23
36
24
- var store = new JSData.DS ();
37
+ var store = new JSData.DataStore ();
25
38
store .registerAdapter (' localstorage' , adapter, { default: true });
26
39
27
- // "store" will now use the localstorage adapter for all async operations
40
+ // "store" will now use the localstorage adapter
28
41
```
29
42
30
43
You can also provide a custom storage medium (it just needs to implement the ` localStorage ` API):
@@ -33,7 +46,7 @@ You can also provide a custom storage medium (it just needs to implement the `lo
33
46
var memory = {};
34
47
35
48
// Turn js-data-localstorage into an in-memory adapter
36
- var memoryAdapter = new DSLocalStorageAdapter ({
49
+ var memoryAdapter = new LocalStorageAdapter ({
37
50
storage: {
38
51
getItem : function (key ) {
39
52
return memory[key];
@@ -48,52 +61,69 @@ var memoryAdapter = new DSLocalStorageAdapter({
48
61
});
49
62
50
63
// Turn js-data-localstorage into a sessionStorage adapter
51
- var sessionAdapter = new DSLocalStorageAdapter ({
64
+ var sessionAdapter = new LocalStorageAdapter ({
52
65
storage: sessionStorage
53
66
});
54
67
```
55
68
56
- ### Changelog
57
- [ CHANGELOG.md] ( https://github.com/js-data/js-data-localstorage/blob/master/CHANGELOG.md )
69
+ ## Documentation
70
+ - [ Getting Started with js-data] ( http://www.js-data.io/docs/home )
71
+ - [ js-data-http] ( http://www.js-data.io/docs/js-data-localstorage )
72
+ - [ CHANGELOG.md] ( https://github.com/js-data/js-data-localstorage/blob/master/CHANGELOG.md )
58
73
59
- ### Community
60
- - [ Slack Channel] [ sl_l ] - Better than IRC!
61
- - [ Announcements] ( http://www.js-data.io/blog )
62
- - [ Mailing List] ( https://groups.io/org/groupsio/jsdata ) - Ask your questions!
63
- - [ Issues] ( https://github.com/js-data/js-data-localstorage/issues ) - Found a bug? Feature request? Submit an issue!
64
- - [ GitHub] ( https://github.com/js-data/js-data-localstorage ) - View the source code for js-data.
65
- - [ Contributing Guide] ( https://github.com/js-data/js-data-localstorage/blob/master/CONTRIBUTING.md )
74
+ ## API Reference
75
+ - [ js-data] ( http://api.js-data.io/js-data/ )
76
+ - [ js-data-localstorage] ( http://api.js-data.io/js-data-localstorage/ )
66
77
67
- ### Contributing
78
+ ## Demo
79
+ [ https://js-data-localstorage.firebaseapp.com/ ] ( https://js-data-localstorage.firebaseapp.com/ )
80
+
81
+ ## Support
68
82
69
- First, support is handled via the [ Slack Channel] [ sl_l ] and the [ Mailing List] ( https://groups.io/org/groupsio/jsdata ) . Ask your questions there.
83
+ Support questions are handled via [ StackOverflow] [ so ] , [ Slack] [ slack ] , and the
84
+ [ Mailing List] [ ml ] . Ask your questions there.
85
+
86
+ ## Community
87
+ - [ StackOverflow Channel] [ so ]
88
+ - [ Slack Chat] [ slack ] [ ![ Slack Status] [ sl_b ]] [ slack ]
89
+ - [ Announcements] ( http://www.js-data.io/blog )
90
+ - [ Mailing List] ( ml )
91
+ - [ Issues Tracker] ( https://github.com/js-data/js-data/issues )
92
+ - [ GitHub] ( https://github.com/js-data/js-data )
93
+ - [ Contributing Guide] ( https://github.com/js-data/js-data/blob/master/CONTRIBUTING.md )
70
94
71
- When submitting issues on GitHub, please include as much detail as possible to make debugging quick and easy.
95
+ ## Contributing
72
96
73
- - good - Your versions of js-data, js-data-localstorage, etc., relevant console logs/error, code examples that revealed the issue
74
- - better - A [ plnkr] ( http://plnkr.co/ ) , [ fiddle] ( http://jsfiddle.net/ ) , or [ bin] ( http://jsbin.com/?html,output ) that demonstrates the issue
75
- - best - A Pull Request that fixes the issue, including test coverage for the issue and the fix
97
+ When submitting bug reports or feature requests on GitHub, please include _ as
98
+ much detail as possible_ .
76
99
77
- [ Github Issues] ( https://github.com/js-data/js-data-localstorage/issues ) .
100
+ - good - Your versions of Angular, JSData, etc, relevant console logs, stack
101
+ traces, code examples that revealed the issue, etc.
102
+ - better - A [ plnkr] ( http://plnkr.co/ ) , [ fiddle] ( http://jsfiddle.net/ ) , or
103
+ [ bin] ( http://jsbin.com/?html,output ) that demonstrates the issue
104
+ - best - A Pull Request that fixes the issue, including test coverage for the
105
+ issue and the fix
78
106
79
- #### Submitting Pull Requests
107
+ ### Pull Requests
80
108
81
- 1 . Contribute to the issue/discussion that is the reason you'll be developing in the first place
82
- 1 . Fork js-data-localstorage
109
+ 1 . Contribute to the issue/discussion that is the reason you'll be developing in
110
+ the first place
111
+ 1 . Fork js-data
83
112
1 . ` git clone [email protected] :<you>/js-data-localstorage.git `
84
113
1 . ` cd js-data-localstorage; npm install; `
85
114
1 . Write your code, including relevant documentation and tests
86
115
1 . Run ` npm test ` (build and test)
87
116
1 . Your code will be linted and checked for formatting, the tests will be run
88
- 1 . The ` dist/ ` folder & files will be generated, do NOT commit ` dist/* ` ! They will be committed when a release is cut.
117
+ 1 . The ` dist/ ` folder & files will be generated, do NOT commit ` dist/* ` ! They
118
+ will be committed when a release is cut.
89
119
1 . Submit your PR and we'll review!
90
120
1 . Thanks!
91
121
92
- ### License
122
+ ## License
93
123
94
124
The MIT License (MIT)
95
125
96
- Copyright (c) 2014-2015 Jason Dobry
126
+ Copyright (c) 2014-2016 Jason Dobry
97
127
98
128
Permission is hereby granted, free of charge, to any person obtaining a copy
99
129
of this software and associated documentation files (the "Software"), to deal
@@ -125,3 +155,4 @@ SOFTWARE.
125
155
[ cov_l ] : https://coveralls.io/github/js-data/js-data-localstorage?branch=master
126
156
[ cod_b ] : https://img.shields.io/codacy/b8e46008e6ad45159b7a6927dbfd66c3.svg
127
157
[ cod_l ] : https://www.codacy.com/app/jasondobry/js-data-localstorage/dashboard
158
+ [ so ] : http://stackoverflow.com/questions/tagged/jsdata
0 commit comments