Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

ember-required-properties

Package Overview
Dependencies
Maintainers
1
Versions
4
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

ember-required-properties

Enforce required properties on components or other objects via a simple-mixin.

  • 0.2.0
  • latest
  • Source
  • npm
  • Socket score

Version published
Maintainers
1
Created
Source

ember-required-properties

CircleCI npm version Code Climate Dependency Status Ember Observer Score

Features

This addon enables the following pattern:

// some-component
export default Component.extend(RequiredProperties, {
  requiredProperties: ['thing', 'another', 'on-select-thing']  
});
{{some-component}}
ERROR: You must provide `thing`, `another`, and `on-select-thing` to {{some-component}}.

Like ember-prop-types, this addon helps ensure required properties are passed to components. This addon is intended to be a much smaller building block. It only verifies required properties are present, not that they are of the correct type.

Installation

ember install ember-required-properties

Usage

Import the mixin anywhere you want to require properties:

import RequiredProperties from 'ember-required-properties/mixins/required-properties';

export Component.extend(RequiredProperties, {
  requiredProperties: ['one', 'two']
});

Now if you fail to pass all of the required properties you will get an error.

NOTE: since we use Ember.assert to throw errors, production will silently fail.

About Echobind

Echobind

Ember Required Properties is maintained and funded by Echobind.
@echobind

We love open source! See our other projects or hire us to help bring your idea to life.

Echobind LLC (c) 2016
@echobind
Licensed under the MIT license

Keywords

FAQs

Package last updated on 31 Jan 2017

Did you know?

Socket

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.

Install

Related posts

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc