Security News
Fluent Assertions Faces Backlash After Abandoning Open Source Licensing
Fluent Assertions is facing backlash after dropping the Apache license for a commercial model, leaving users blindsided and questioning contributor rights.
cycle-vtree-switcher
Advanced tools
A helper for Cycle.js apps to perform routing.
npm install cycle-vtree-switcher
vtreeSwitcher(routes: Object, responses: Object) -> [vtree$: Observable, requests: Object]
Input:
routes
: an object mapping from routington
route definitions to route handlers which are functions like Cycle.js main functions: main(responses: Object) -> requests: Object
responses
: an object containing Cycle.js driver responses/sources. Must include a Path
response, which can be built using cycle-pushstate-driver
Output:
vtree$
: an Observable of vtrees that is the result of switching among the vtree outputs of the route handlers according to the current pathrequests
: an object containing Cycle.js driver requests/sinks, which you can combine to return to the driversBasics:
import { makeRouter } from 'cycle-route'
const router = makeRouter({
'/': 'home',
'/foo/:bar': 'foo',
'*': 'notfound' // default route
})
router('/')
Cycle.js use case:
import { run, Rx } from '@cycle/core'
import { makeDOMDriver } from '@cycle/dom'
import { makeFetchDriver } from ‘@cycle/fetch’
import { makePushStateDriver } from 'cycle-pushstate-driver'
import vtreeSwitcher from 'cycle-vtree-switcher'
import owers from './owers'
import owees from './owees'
import transactions from './transactions'
import notfound from './notfound'
const routes = {
'/': owers,
'/owers/:ower': owees,
'/transactions/:ower/:owee': transactions,
'*': notfound
}
function main (responses) {
const { DOM, Fetch, Path } = responses
const [vtree$, requestMap] = vtreeSwitcher(routes, responses)
return {
DOM: vtree$,
Path: navigate$
}
}
run(main, {
DOM: makeDOMDriver('main'),
Path: makePushStateDriver()
})
FAQs
A Cycle.js helper for switching between route handlers
The npm package cycle-vtree-switcher receives a total of 6 weekly downloads. As such, cycle-vtree-switcher popularity was classified as not popular.
We found that cycle-vtree-switcher 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
Fluent Assertions is facing backlash after dropping the Apache license for a commercial model, leaving users blindsided and questioning contributor rights.
Research
Security News
Socket researchers uncover the risks of a malicious Python package targeting Discord developers.
Security News
The UK is proposing a bold ban on ransomware payments by public entities to disrupt cybercrime, protect critical services, and lead global cybersecurity efforts.