Security News
The Unpaid Backbone of Open Source: Solo Maintainers Face Increasing Security Demands
Solo open source maintainers face burnout and security challenges, with 60% unpaid and 60% considering quitting.
atomic-router
Advanced tools
Simple routing implementation that provides abstraction layer instead of inline URL's and does not break your architecture
Simple routing implementation that provides abstraction layer instead of inline URL's and does not break your architecture
history
instance)$ npm install effector atomic-router
Create your routes wherever you want:
// pages/home
export const homeRoute = createRoute()
// pages/posts
export const postsRoute = createRoute<{ postId: string }>()
And then create a router
// app/routing
import { homeRoute } from '@/pages/home'
import { postsRoute } from '@/pages/home'
const routes = [
{ path: '/', route: homeRoute },
{ path: '/posts', route: postsRoute },
]
createRouter({
routes: routes,
// Optional
history: createBrowserHistory()
})
There are 3 purposes for using atomic routes:
// model.ts
export const getPostFx = createEffect<{ postId:string }, Post>(({ postId }) => {
return api.get(`/posts/${postId}`)
})
export const $post = restore(getPostFx.doneData, null)
//route.ts
import { getPostFx } from './model'
const postPage = createRoute<{ postId: string }>()
guard({
source: postPage.$params,
filter: postPage.$isOpened,
target: getPostFx
})
// Stores
route.$isOpened // Store<boolean>
route.$params // Store<{ [key]: string }>
route.$query // Store<{ [key]: string }>
// Events (only watch 'em)
route.opened // Event<{ params: RouteParams, query: RouteQuery }>
route.left // Event<{ params: RouteParams, query: RouteQuery }>
// Effects
route.open // Effect<RouteParams>
route.navigate // Effect<{ params: RouteParams, query: RouteQuery }>
FAQs
Simple routing implementation that provides abstraction layer instead of inline URL's and does not break your architecture
The npm package atomic-router receives a total of 813 weekly downloads. As such, atomic-router popularity was classified as not popular.
We found that atomic-router demonstrated a healthy version release cadence and project activity because the last version was released less than a year ago. It has 3 open source maintainers 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
Solo open source maintainers face burnout and security challenges, with 60% unpaid and 60% considering quitting.
Security News
License exceptions modify the terms of open source licenses, impacting how software can be used, modified, and distributed. Developers should be aware of the legal implications of these exceptions.
Security News
A developer is accusing Tencent of violating the GPL by modifying a Python utility and changing its license to BSD, highlighting the importance of copyleft compliance.