2.0.0 • Published 7 years ago

apeman-service-url v2.0.0

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

apeman-service-url

Build Status npm Version JS Standard

Service for URL

Installation

$ npm install apeman-service-url --save

Usage

#!/usr/bin/env node

'use strict'

const { ApUrlService } = require('apeman-service-url')
const { createStore } = require('redux')
const { reducer } = require('apeman-service-base')
const co = require('co')

co(function * () {
  let store = createStore(reducer)
  let service = new ApUrlService(store)

  let link = service.resolveLink('/foo/:bar_id', {
    barId: 3
  })

  /* ... */
}).catch((err) => console.error(err))

API

apeman-service-url@2.0.0

Service for URL

Functions

create(args) -> ApUrlService

Create the service instance

ParamTypeDescription
args*

ApUrlService Class

Service

new ApUrlService(store, options)

Constructor of ApUrlService class

ParamTypeDescription
storeObjectRedux store
optionsObjectOptional settings

service.resolveLink(url, params) -> string

Resolve an link

ParamTypeDescription
urlstringUrl string
paramsObjectURL param values

service.mergeQueryString(url, query) -> string

Merge query string

ParamTypeDescription
urlstringUrl to merge with
queryObjectQuery data

License

This software is released under the MIT License.

Links

2.0.0

7 years ago

1.0.0

7 years ago