1.0.3 • Published 9 years ago

@cnbritain/merlin-frontend-store-js v1.0.3

Weekly downloads
1
License
ISC
Repository
github
Last release
9 years ago

merlin-frontend-store-js

Localstorage module that basically uses the Store

JS Documentation

store

store.clear()

Clears all the data

Kind: static method of store

store.forEach(callback)

Loops over each item stored

Kind: static method of store

ParamType
callbackfunction

store.get(key, defaultVal) ⇒ *

Gets the value

Kind: static method of store

ParamTypeDescription
keyString
defaultVal*Default value if key is not found

store.getAll() ⇒ Object

Gets all the data

Kind: static method of store

store.remove(key)

Removes an item from the data

Kind: static method of store

ParamType
keyString

store.set(key, val) ⇒ *

Sets a value

Kind: static method of store
Returns: * - The value

ParamType
keyString
val*

LocalStorage keys

KeyPageDescription
search_querySearchHolds the search query. Used for infinite scroll
article_referral_uidArticleHolds the referrer article uid. Used for infinite scroll
article_exclude_uidArticleHolds the article uid of the article to exclude. Used for infinite scroll
article_infinite_scrollArticleTurns infinite scroll on and off. Used for infinite scroll
search_querySearchHolds the search term. Used for infinite scroll
tag_infinite_urlTagHolds the url of the current tag page. Used for infinite scroll
tag_infinite_scrollTagTurns infinite scroll on and off. Used for infinite scroll

Prerequisites:

  • Node.jsbrew install node
  • Grunt - npm install -g grunt-cli
  • Other prereqs? Python? Virtualenv?

Demo:

Install dependencies:

npm install

Build the things:

npm run sass
npm run js
npm run docs

Hint your JS

npm run jshint

Python the pythons:

npm run demo-install

Start the demo server:

python demo.py
1.0.3

9 years ago

1.0.2

9 years ago

1.0.1

9 years ago

1.0.0

9 years ago