0.5.3 • Published 9 years ago

cerebral-url-scheme-compiler v0.5.3

Weekly downloads
23
License
MIT
Repository
github
Last release
9 years ago

cerebral-url-scheme-compiler Build Status

The url scheme compiler for Cerebral

getCompiler

converts a path URL into an efficient getter function

import getCompiler from 'cerebral-url-scheme-compiler/get';

// some action factory
export default function (fromPath) {
  // "compile" the fromPath into a getValue function
  const getValue = getCompiler(fromPath);
  // return an action
  return function myAction (args) {
    let value = getValue(args);
    // do something with value ...
  }
}

setCompiler

converts a path URL into an efficient setter function

import setCompiler from 'cerebral-url-scheme-compiler/set';

// some action factory
export default function (toPath) {
  // "compile" the toPath into a setValue function
  const setValue = setCompiler(toPath);
  // return an action
  return function myAction (args) {
    // do something to get the value
    setValue(args, value);
  }
}

Contribute

Fork repo

  • npm install
  • npm start runs dev mode which watches for changes and auto lints, tests and builds
  • npm test runs the tests
  • npm run lint lints the code
  • npm run build compiles es6 to es5
0.5.3

9 years ago

0.5.2

9 years ago

0.5.1

9 years ago

0.5.0

9 years ago

0.4.1

9 years ago

0.4.0

9 years ago

0.3.7

9 years ago

0.3.6

9 years ago

0.3.5

10 years ago

0.3.4

10 years ago

0.3.3

10 years ago

0.3.2

10 years ago

0.3.1

10 years ago

0.3.0

10 years ago

0.2.0

10 years ago

0.1.1

10 years ago