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-reactive-helpers

v1.2.0

Published

Collection of helpers to aid in reactive template programming with Ember.js

Downloads

25

Readme

ember-reactive-helpers

NPM Version Build Status Ember Observer Score Download Count

Collection of helpers to aid in reactive template programming with Ember.js.

Installation

ember install ember-reactive-helpers

Introduction

Reactive helpers are helpers that return functions. These functions can be bound to event handlers to process data on the way up in the Data Down Actions Up cycle. The r helper makes it possible to use ember-composable-helpers in event handlers where execution of the helper is delayed until the event is triggered.

Helpers

(r helper [arg1 arg2 ...])

Returns a function for a given helper and curries arguments to it.

<Input @value={{this.value}} {{on "keyup" (pipe (r "dasherize" this.value) (fn (mut this.value)))}} />

The r helper accepts functions as helpers. For example, let's say you have a method in a Component named addNumbers

export default class extends Component {
  addNumbers([a, b]) {
    return a + b;
  }
}

You can use it in the template.

<button type="button" {{on "click" (pipe (r this.addNumbers 1) (fn (mut this.count)))}}>+1</button>
<div>{{this.count}}</div>

(r/get propName)

The (r/get) helper returns a function. When called, the function will return the value taken from the object that it receives as the first argument at property propName.

{{compute (r/get "animal") (hash animal="cat")}} {{! //=> cat }}

(r/param [index])

(r/param) returns a function. When called, this function will return the received argument at the specified index.

{{compute (r/param) "hello" "world"}}
{{! //=> 'hello'}}
{{compute (r/param 1) "hello" "world"}}
{{! //=> 'world'}}

(r/debugger)

(r/debugger) will create a helper that will inject a debugger breakpoint into a helper pipe. It will pass through the value, that's passed into the helper.

<button {{action (pipe (some-helper) (r/debugger) (some-other-helper))}}>Do!</button>

(r/log ['your message'])

The (r/log) helper will evaluate to a function. When called, this function will log the passed in message and arguments that it received.

<button {{action (pipe (r/log "before save") (action "save") (r/log "after save")) model}}>Save</button>

(r/tap value)

The (r/tap value) helper will evaluate to a function that will return the passed in argument.

{{shhh anything}}

The {{shhh helper will suppress any output that's passed into it. This is useful when you want to compute a helper without having its output rendered.

(transition-to 'destination' model (query-params foo='bar'))

The (transition-to) helper has the same argument signature as link-to but evaluates to an action that can be called to trigger transition.

<button type="button" {{on "click" (transition-to "index")}}>Go to Index</button>

Helpful Links

Looking for help?

If you encounter a bug please open an issue on GitHub.

Compatibility

  • Ember.js v3.28 or above
  • Ember CLI v3.28 or above
  • Node.js v14 or above

Contributing

See the Contributing guide for details.

License

This project is licensed under the MIT License.