@erickmerchant/framework
Advanced tools
Comparing version 10.0.3 to 11.0.0
28
main.js
@@ -1,13 +0,5 @@ | ||
module.exports = function ({target, store, component, diff, options, raf}) { | ||
module.exports = function ({target, store, component, diff, raf}) { | ||
raf = raf != null ? raf : window.requestAnimationFrame | ||
if (options != null) { | ||
options.dispatch = dispatch | ||
options.next = next | ||
} else { | ||
options = {dispatch, next} | ||
} | ||
let stores = !Array.isArray(store) ? [store] : store | ||
let state = stores.reduce((state, store) => store(state)) | ||
let state = store() | ||
let rafCalled = false | ||
@@ -20,9 +12,7 @@ | ||
function dispatch () { | ||
state = stores.reduce((state, store) => { | ||
const args = (arguments.length === 1 ? [arguments[0]] : Array.apply(null, arguments)) | ||
const args = (arguments.length === 1 ? [arguments[0]] : Array.apply(null, arguments)) | ||
args.unshift(state) | ||
args.unshift(state) | ||
return store.apply(null, args) | ||
}, state) | ||
state = store.apply(null, args) | ||
@@ -39,10 +29,4 @@ if (!rafCalled) { | ||
let app = {state} | ||
const element = component({state, dispatch, next}) | ||
Object.keys(options).forEach(function (prop) { | ||
app[prop] = options[prop] | ||
}) | ||
const element = component(app) | ||
if (element != null) { | ||
@@ -49,0 +33,0 @@ diff(target, element) |
{ | ||
"name": "@erickmerchant/framework", | ||
"version": "10.0.3", | ||
"version": "11.0.0", | ||
"description": "A simple data down, actions up framework.", | ||
@@ -5,0 +5,0 @@ "main": "main.js", |
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
7134
95