@profiscience/knockout-contrib-router-middleware-loading
v1.0.18
Published
[![Version][npm-version-shield]][npm] [![Dependency Status][david-dm-shield]][david-dm] [![Peer Dependency Status][david-dm-peer-shield]][david-dm-peer] [![Dev Dependency Status][david-dm-dev-shield]][david-dm-dev] [![Downloads][npm-stats-shield]][npm-sta
Downloads
80
Readme
router.middleware.loading
NOTE: This package is intended for consumption via the @profiscience/knockout-contrib metapackage
Eases creation of loading middlware
Usage
import { Router, createLoadingMiddleware } from '@profiscience/knockout-contrib'
Router.use(
createLoadingMiddleware({
start() {
showLoader()
},
end() {
hideLoader()
},
/* OPTIONAL */
minDuration: 0, // prevent flickering on fast navigation (show loader for at least <n> ms)
})
)