![Introducing Enhanced Alert Actions and Triage Functionality](https://cdn.sanity.io/images/cgdhsj6q/production/fe71306d515f85de6139b46745ea7180362324f0-2530x946.png?w=800&fit=max&auto=format)
Product
Introducing Enhanced Alert Actions and Triage Functionality
Socket now supports four distinct alert actions instead of the previous two, and alert triaging allows users to override the actions taken for all individual alerts.
@blumjs/router
Advanced tools
Readme
This library based on effector and window.history.state without changing url and hash. Created for routing vk-mini-apps. I recomend use it with @blumjs/cli.
To Route handle prev button in browser, you should init first:
import { useInitRouter } from '@blumjs/router';
const App = () => {
useInitRouter({
view: "Main",
panel: "Home",
modal: null,
popout: null
});
...
}
To handle prev button you can use middlewares:
import { useInitRouter, createDisableBackBrowserRouteMiddleware, createRouteMiddleware, historyPush } from '@blumjs/router';
const App = () => {
useInitRouter({
view: "Main",
panel: "Home",
modal: null,
popout: null
},
//first arg is the name of route; second callback, that fired when pushed back in browser
createDisableBackBrowserRouteMiddleware('Loading', (storeRoutes, prevRoutes) => console.log('loading, please wait...')),
createRouteMiddleware((storeRoutes, prevRoutes) => {
if(navigator.onLine){
//middleware passed
return true;
}
historyPush({view: 'ConnectionError', panel: 'Offline', modal: null, popout: null});
return false;
})
);
...
}
To get routes and check initialization routes:
import { useRouter } from '@blumjs/router';
const App = () => {
const { activeView, activePanel, activeModal, activePopout, isRouteInit } = useRouter();
...
}
To set routes you can use functions: setRoutes(set all routes), setActiveView, setActivePanel, setActiveModal, setActivePopout.
import { setRoutes, setActiveView, setActivePanel, setActiveModal, setActivePopout } from '@blumjs/router';
//setRoutes accept partial routes
setRoutes({view: 'Main', panel: 'Home'});
setRoutes({modal: 'Onboarding'});
setRoutes({panel: 'Game', popout: 'Loading'});
setActiveView('Main');
setActivePanel('Home');
setActiveModal('Notifications');
setActivePopout('Loading');
To get previous page use back:
import { back } from '@blumjs/router';
back();
If you need turn off modal and popout in new page (for example, offline page, where user shouldn't see modal and popout) you can use _setActiveModal, _setActivePopout. In other case use back.
import { _setActiveModal, _setActivePopout } from '@blumjs/router';
_setActiveModal(null);
_setActivePopout(null);
FAQs
Роутер для vk-mini-apps
The npm package @blumjs/router receives a total of 2 weekly downloads. As such, @blumjs/router popularity was classified as not popular.
We found that @blumjs/router demonstrated a healthy version release cadence and project activity because the last version was released less than 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.
Product
Socket now supports four distinct alert actions instead of the previous two, and alert triaging allows users to override the actions taken for all individual alerts.
Security News
Polyfill.io has been serving malware for months via its CDN, after the project's open source maintainer sold the service to a company based in China.
Security News
OpenSSF is warning open source maintainers to stay vigilant against reputation farming on GitHub, where users artificially inflate their status by manipulating interactions on closed issues and PRs.