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.
@uirouter/rx
Advanced tools
Reactive Extensions (RxJS) for UI-Router
This UI-Router plugin exposes various events in UI-Router as RxJS Observables.
This helps you to use UI-Router in a reactive mode.
This plugin works with UI-Router Core 2.0 and above (angular-ui-router 1.0.0-rc.1+, ui-router-ng2 1.0.0-beta.4+, ui-router-react 0.4.0+).
npm install ui-router-rx
This is a UI-Router Plugin.
Add the UIRouterRx
plugin to your app's UIRouter
instance.
import { UIRouterRx } from "ui-router-rx";
// ... after UI-Router bootstrap, get a reference to the `UIRouter` instance
// ... call `.plugin()` to register the ui-router-rx plugin
uiRouter.plugin(UIRouterRx);
In a state definition,
const foo$ = (uiRouter) =>
uiRouter.globals.params$.map(params => params.fooId)
.distinctUntilChanged()
.map(fooId => fetch('/foo/' + fooId).then(resp => resp.json()))
var fooState = {
name: 'foo',
url: '/foo/{fooId}',
component: FooComponent,
resolve: [
{ token: 'foo$', deps: [ UIRouter ], resolveFn: foo$ }
]
})
In the component, access the foo$
resolve value (it will be an Observable). Subscribe to it and do something with it when it emits a new value.
var subscription = foo$.subscribe(foo => this.foo = foo);
Don't forget to unsubscribe when the component is destroyed.
subscription.unsubscribe();
0.4.4 (2017-10-12)
FAQs
Reactive extensions for UI-Router
The npm package @uirouter/rx receives a total of 18,935 weekly downloads. As such, @uirouter/rx popularity was classified as popular.
We found that @uirouter/rx demonstrated a not healthy version release cadence and project activity because the last version was released a year ago. It has 4 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
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.