npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2024 – Pkg Stats / Ryan Hefner

ember-cli-rxjs

v2.2.0

Published

RxJS utilities for Ember.

Downloads

8

Readme

ember-cli-rxjs

Description

Exposes some simple utilities for creating and consuming RxJs Observables within your Ember application.

Installation

$ ember install ember-cli-rxjs

Usage

After installing the addon, you will have access to a few utilities for creating Observables from Controllers, Routes, and Components. These utilities live in the this.observable namespace from within your objects.

This addon also enables you to return an Observable from your Routes' model hook (as you might return a Promise). If your model hook returns an Observable, it will be subscribed to, updating the model with every emitted value.

You can import RxJs from the rxjs module:

import Rx from 'rxjs/Rx';

Note that - for the sake of your build sizes - only the operators and observables necessary to implement the utilities below are imported within the addon. This means that in order to use the majority of RxJs' operators, you will need to import them (or everything from rxjs/Rx) in your own app.

More on that here.

Utilities

General methods

this.observable.property(propertyName): Observe the value of a given property and emit new values as the property value changes.

this.observable.properties(prop1, prop2, ...): Observe multiple property values and emit a hash of the current value of these properties (a la getProperties) whenever any of them changes.

this.observable.action(actionName): Observe an action, and emit a message whenever the action is invoked. If you define an action handler in the actions hash, and observe that action with this method, the handler will be invoked before the Observable emits its message. Actions observed this way will not bubble by default. If you need the action to bubble, return true from the actions hash handler.

Route methods

this.subscribeController(controller): If the Route's model is an Observable, subscribe controller to that observable, updating it's model with emitted values. This is called during setupController.

this.unsubscribeController(controller): Unsubscribe the model subscription for the given controller. You might call this method during resetController when the Route is exiting, for instance.