
Security News
Attackers Are Hunting High-Impact Node.js Maintainers in a Coordinated Social Engineering Campaign
Multiple high-impact npm maintainers confirm they have been targeted in the same social engineering campaign that compromised Axios.
patch-history
Advanced tools
Manage your history state in patchcore based apps.
Patchcore and related modules use depject to provide (give) and consume (need) dependencies.
history.obs.store(Not generally for public use)
The history store in the form of a Mutant Array. This is an observeable, which is excellent for building things with Mutant.
history.obs.locationThe current location as in history, as Mutant Value.
A crude was to access the contents of a Mutant observeable is to call it:
const currentLocation = api.history.obs.location() // observeable
currentLocation() // => array
You can also subscribe listeners which will be called when the observeable updates:
const listener = (location) => console.log('new location', location)
currentLocation(listener)
history.sync.pushA synchronous method which allows you to push a new location onto the end of the history.
history.sync.backA synchronous method which moves the current location back a step in histroy.
// main.js
const combine = require('depject')
const entry = require('depject/entry')
const nest = require('depnest')
const sockets = combine(
require('./index.js'), // an object of depject modules
require('patch-history'),
require('patchcore')
)
const api = entry(sockets, nest('app.html.app', 'first'))
const app = api.app.html.app()
// homePage.js
const html = require('yo-yo')
export.gives = nest('app.page.homePage')
exports.needs = nest({
'history.sync.push': 'first'
'history.sync.back': 'first'
})
exports.create = (api) => {
return nest('app.page.homePage', homePage)
function homePage () {
const goToSettings = () => api.history.sync.push({ page: '/settings' })
// you can push whatever you want into history, it's just an array
return html`
<div>
Hi, check your <button onclick=${goHome}> settings </button>
<div>
`
}
}
// app.js
export.gives = nest('app.html.app')
exports.needs = nest({
'history.obs.location': 'first',
'history.sync.push': 'first',
'router.sync.router': 'first'
})
exports.create = (api) => {
return nest('app.html.app', app)
function app () {
const currentLocation = api.history.obs.location()
currentLocation(renderPage)
// currentLocation is an observable which can be passed listeners
// these will be called when the location changes
api.history.sync.push({ page: '/home' })
}
function renderPage (newLocation) {
const newView = api.route.sync.router(newLocation)
document.body.appendChild(newView)
// crude 'rendering'!
}
}
FAQs
A history module for patchcore compatable apps.
We found that patch-history demonstrated a not healthy version release cadence and project activity because the last version was released a year ago. It has 1 open source maintainer collaborating on the project.
Did you know?

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Security News
Multiple high-impact npm maintainers confirm they have been targeted in the same social engineering campaign that compromised Axios.

Security News
Axios compromise traced to social engineering, showing how attacks on maintainers can bypass controls and expose the broader software supply chain.

Security News
Node.js has paused its bug bounty program after funding ended, removing payouts for vulnerability reports but keeping its security process unchanged.