0.4.17 • Published 8 years ago

param-store-test v0.4.17

Weekly downloads
2
License
MIT
Repository
github
Last release
8 years ago

param-store

param-store manage the url. What's special about it is it treats url as independent params which can be set and get.

Travis build status npm Dependency Status devDependency Status

API

ParamStore

import ParamStore from 'param-store'

// path is a special param in the sense that it is the path in the url
// instead of in the query part.
// Otherwise it is the same as other query params.

// SETTER
ParamStore.set({path: 'login'}) // change current params
Paramstore.reset({path: 'login'}) // overwrite current params

// GETTER
ParamStore.get('path') // get whole params object
ParamStore.getAll() // get whole params object
ParamStore.pick(['path', 'tab']) // return  {path: 'path', tab: 'tab'}

// LISTENNER
const listener = ParamStore.listen('path', 'tab', function(report){
  const {changedParams, currentParams, previousParams} = report
})
ParamStore.unlisten(listener)

connect

import {connect} from 'param-store'

connect(Login, 'path', 'tab’) // path and tab will be passed as props

Link

import {Link} from 'param-store'

<Link type='button' params={{path: 'about'}}>this is an anchor tag</Link>

DEVELOPMENT

  • test
    npm run browser
0.4.17

8 years ago

0.4.16

8 years ago

0.4.15

8 years ago

0.4.14

8 years ago

0.4.13

8 years ago

0.4.12

8 years ago

0.4.11

8 years ago

0.4.10

8 years ago

0.4.9

8 years ago

0.4.8

8 years ago

0.4.7

8 years ago