peerlibrary/meteor-blaze-common-component

Name: meteor-blaze-common-component

Owner: PeerLibrary

Description: An extended base Blaze Component with common features

Created: 2016-02-28 20:12:57.0

Updated: 2016-11-21 00:57:03.0

Pushed: 2018-02-25 11:00:14.0

Homepage: null

Size: 156

Language: CoffeeScript

GitHub Committers

UserMost Recent Commit# Commits

Other Committers

UserEmailMost Recent Commit# Commits

README

Common Component

An alternative base Blaze Component extended with common features.

Adding this package to your Meteor application adds CommonComponent and CommonMixin classes into the global scope.

Pull requests with new features are more than encouraged. Let us all combine our common practices and patterns together. We can always split it later into smaller packages.

Both client and server side.

Installation
or add peerlibrary:blaze-common-component
Usage

You can use CommonComponent as a base class for your components and CommonMixin for your mixins.

The idea is that instead of using Blaze global template helpers you can simply use methods shared between all your components by using a common base class for them. In this way interaction between helpers is much cleaner and can nicely tie into the rest of the object-oriented programming.

This package provides some common features community found useful in their components.

The suggested pattern is that in your application your first extend the CommonComponent with an app-level base class for all your components in the app, and then use that app-level base class in your app. Something like:

s AppBaseComponent extends CommonComponent {
 All app-level methods.


s BlogPostComponent extends AppBaseComponent {
 Your component for blog posts.


PostComponent.register('BlogPostComponent');

In this way it is easy to later on add new features app-wide. And remember, if some feature is very useful to you, it will probably be useful to others as well. Consider contributing it to this package.

Available features

See generated documentation for documentation of all features available.


This work is supported by the National Institutes of Health's National Center for Advancing Translational Sciences, Grant Number U24TR002306. This work is solely the responsibility of the creators and does not necessarily represent the official views of the National Institutes of Health.