Skip to content
This repository has been archived by the owner on Nov 15, 2017. It is now read-only.

Commit

Permalink
Remove curried fnt and replace with closure
Browse files Browse the repository at this point in the history
  • Loading branch information
fastner committed May 12, 2016
1 parent 4b88d46 commit ddb7ca1
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions src/VuexValidator.js
Original file line number Diff line number Diff line change
Expand Up @@ -85,6 +85,7 @@ function install(Vue, { validators: _validators } = { validators: [] })
const options = this.$options
const getters = options.computed = options.computed || {}
const state = this.$store.state
const statedPropertyValidator = propertyValidator(state)

validators.forEach((item) =>
{
Expand All @@ -108,8 +109,8 @@ function install(Vue, { validators: _validators } = { validators: [] })
const vals = options.vuex.validators
Object.keys(vals).forEach((prop) =>
{
const curriedFnt = curry(vals[prop], 1)(propertyValidator(state))
getters[prop] = curriedFnt
const currentPropertyFnt = vals[prop]
getters[prop] = () => currentPropertyFnt(statedPropertyValidator)
})
}
}
Expand Down

0 comments on commit ddb7ca1

Please sign in to comment.