Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

@erickmerchant/framework

Package Overview
Dependencies
Maintainers
1
Versions
244
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@erickmerchant/framework - npm Package Compare versions

Comparing version 7.0.0 to 7.1.0

10

main.js
const catchLinks = require('catch-links')
const singlePage = require('single-page')
module.exports = function ({target, store, component, diff}) {
module.exports = function ({target, store, component, diff, raf}) {
raf = raf != null ? raf : window.requestAnimationFrame
let href

@@ -17,2 +19,6 @@ let state = store()

return function (init) {
init({state, dispatch})
}
function dispatch () {

@@ -28,3 +34,3 @@ state = store(state, ...arguments)

window.requestAnimationFrame(() => {
raf(() => {
rafCalled = false

@@ -31,0 +37,0 @@

4

package.json
{
"name": "@erickmerchant/framework",
"version": "7.0.0",
"version": "7.1.0",
"description": "A simple data down, actions up framework.",

@@ -26,3 +26,3 @@ "main": "dist/main.js",

"mockery": "^2.0.0",
"nyc": "^8.0.0",
"nyc": "^10.0.0",
"standard": "^8.0.0",

@@ -29,0 +29,0 @@ "tape": "^4.6.0"

var test = require('tape')
var mockery = require('mockery')
test('', function (t) {
t.plan(1)
test('test main', function (t) {
let singlePage
let theTarget = {}
let dispatchRun = false
let nextRun = false
t.ok(true)
mockery.enable({
useCleanCache: true,
warnOnReplace: false,
warnOnUnregistered: false
})
t.plan(12)
mockery.registerMock('single-page', function (callback) {
singlePage = callback
return callback
})
mockery.registerMock('catch-links', function (target, callback) {
t.equal(target, theTarget)
t.equal(callback, singlePage)
})
require('./main.js')({
target: theTarget,
store: function () {
return {}
},
component: function (href) {
t.equal(href, '/new-href')
return function (app) {
t.deepEqual(Object.keys(app), ['state', 'dispatch', 'show', 'next'])
if (!dispatchRun) {
dispatchRun = true
process.nextTick(function () {
app.dispatch()
app.dispatch()
}, 0)
}
if (!nextRun) {
nextRun = true
app.next(function (target) {
t.deepEqual(target, theTarget)
})
}
return {}
}
},
diff: function (target, newTarget) {
t.equal(target, theTarget)
t.deepEqual(newTarget, {})
},
raf: function (callback) {
process.nextTick(function () { callback() })
}
})(function (app) {
t.deepEqual(Object.keys(app), ['state', 'dispatch'])
})
singlePage('/new-href')
mockery.disable()
})
SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc