# backbone.component

> Backbone.Component

Latest version **1.0.3** (published 2016-08-18) · ISC license · 0 weekly downloads

## Install

```sh
npm install backbone.component
pnpm add backbone.component
yarn add backbone.component
bun add backbone.component
```

## Health

**Score 15/100 (F)** — status: abandoned.

Positive: no vulnerabilities.

Warnings: low downloads; no types; no esm support.

Negative: abandoned; low maintenance score.

## Facts

| | |
|---|---|
| Version | 1.0.3 |
| Published | 2016-08-18 |
| First published | 2016-01-20 |
| Weekly downloads | 0 |
| License | ISC |
| TypeScript types | none |
| Module format | CommonJS |
| Dependencies | 2 |
| Known vulnerabilities | 0 (+2 in 1 direct dependencies) |
| Install scripts | no |
| GitHub stars | 0 |
| Author | Pavel Kondratenko |
| Maintainers | gustarus |
| Keywords | bacbkone.component |

## Links

- npm: https://www.npmjs.com/package/backbone.component
- Repository: https://github.com/gustarus/backbone.component
- Homepage: https://github.com/gustarus/backbone.component#readme
- Issues: https://github.com/gustarus/backbone.component/issues
- npm.io page: https://npm.io/package/backbone.component

## Dependencies (2)

- [backbone](https://npm.io/package/backbone.md) 1.2.3
- [underscore](https://npm.io/package/underscore.md) 1.8.3

## Recent versions

- 1.0.3 (latest) — 2016-08-18
- 1.0.2 — 2016-08-12
- 1.0.1 — 2016-08-12
- 1.0.0 — 2016-08-12
- 0.5.4 — 2016-02-01
- 0.5.3 — 2016-02-01
- 0.5.2 — 2016-02-01
- 0.5.1 — 2016-02-01
- 0.5.0 — 2016-01-22
- 0.4.2 — 2016-01-21
- 0.4.1 — 2016-01-21
- 0.4.0 — 2016-01-21
- 0.3.0 — 2016-01-21
- 0.2.0 — 2016-01-21
- 0.1.1 — 2016-01-20
- … 1 more at https://npm.io/package/backbone.component/versions

## README

# Backbone model without attributes
This package describes light version of the [Backbone.Model](http://backbonejs.org/#Model). You can use this component when you doesn't need the Backbone.Model attributes functionality like [model.set()](http://backbonejs.org/#Model-set) or [model.get()](http://backbonejs.org/#Model-get) methods and change events. But this component have all [Backbone.Events](http://backbonejs.org/#Events) functionality.

## Properties assign functionality
This component have a properties-assign logic. This means, that when you create the component, you can pass object with properties in first constructor argument. Look at the [usage example](#usage-example) below.

## Usage example
You can find this code in [sample folder](https://github.com/gustarus/backbone.component/blob/release/v1.0.0/sample/index.js).
```javascript
'use strict';
 
const Component = require('backbone.component');
 
const Person = Component.extend({
  name: null
});
 
const Man = Person;
 
const Woman = Person.extend({
  want(target) {
    this.trigger('want', target);
  }
});
 
let john = new Man({name: 'John'});
let kate = new Woman({name: 'Kate'});
 
john.listenTo(kate, 'want', target => {
  console.log(`${kate.name}, ${target} is really expensive!`);
});
 
kate.want('car');
```

Also you can run this code from console from your project folder.
```bash
node ./node_modules/backbone.component/sample/index.js
```

## Installation
Run this code from your project root folder.
```bash
npm i backbone.component --save-dev
```

---
_Source: https://npm.io/package/backbone.component · Machine-readable twin of the npm.io package page. Health data is recomputed on every publish._
