Socket
Socket
Sign inDemoInstall

atom-metal-snippets

Package Overview
Dependencies
0
Maintainers
1
Versions
1
Alerts
File Explorer

Advanced tools

Install Socket

Detect and block malicious and high-risk dependencies

Install

    atom-metal-snippets

Snippets for metal.js


Version published
Maintainers
1
Install size
8.83 kB
Created

Readme

Source

Atom Metal.js Snippets

An Atom snippet library for Metal.js, and metal-css-transitions. This library uses ES6 syntax.

Install via apm install atom-metal-snippets

Includes

Imports

[ict]
import Transition from 'metal-css-transitions';
[ijsx]
import Component from 'metal-jsx';
[imr]
import ${1} from 'metal-redux';
[isoy]
import Component from 'metal-soy';

JSX

[bind]
this.${1} = this.${1}.bind(this);
[jsx]
import Component, {Config} from 'metal-jsx';

class ${1:MyComponent} extends Component {
	render() {
		return (
			${2:<div>MyComponent</div>}
		);
	}
}

${1:MyComponent}.PROPS = {
};

${1:MyComponent}.STATE = {
};

export default ${1:MyComponent};
[trans]
<Transition name="$1">
		${2}
</Transition>

Life Cycles

[att]
attached() {
	${1}
}
[cre]
created() {
	${1}
}
[det]
detached() {
	${1}
}
[dis]
disposed() {
	${1}
}
[ren]
render() {
	return (
		${2}
	);
}
[rend]
rendered() {
	${1}
}
[shup]
shouldUpdate(newState, newProps) {
	${1}
}
[sync]
sync$1(newVal, prevVal) {
	${2}
}

State Management

[sst]
this.setState({$1});
[PRO]
${1}.PROPS = {
	${2}
};
[STA]
${1}.STATE = {
	${2}
};

Types

[conan]
Config.any()
[conarr]
Config.conarr()
[conarro]
Config.arrayOf(${1})
[conboo]
Config.bool()
[confun]
Config.func()
[conino]
Config.instanceOf(${1})
[connum]
Config.number()
[conob]
Config.object()
[conobo]
Config.objectOf(${1})
[conoot]
Config.oneOfType(
	[
		${1},
	]
)
[consha]
Config.shapeOf(
	{
		${1}
	}
)
[constr]
Config.string()
[conval]
Config.value(${1})

Keywords

FAQs

Last updated on 18 Nov 2016

Did you know?

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

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc