3.0.8 • Published 7 years ago

@chickendinosaur/inferno-storex v3.0.8

Weekly downloads
1
License
MIT
Repository
github
Last release
7 years ago

Inferno container creator for Storex connections.


Specs

Performance

@chickendinosaur/inferno-storex


Overhead

@chickendinosaur/inferno-storex

Browserify (minified) \w with connect and Provider

34758 bytes

inferno-redux

Browserify (minified) \w with connect and Provider

53675 bytes


Getting Started

Installation

npm

npm install @chickendinosaur/inferno-storex

Usage

import { Store, Reducer } from '@chickendinosaur/storex';
import { connect, Provider } from '@chickendinosaur/inferno-storex';

// Store.
const store = new Store(new Reducer({
	addCount: function (state, action) {
		state.count += action.payload.incAmount
	}
}), {
	count: 5
});

// Test component.
function TestContainer (props, context) {
	return (
		<div>
			{props.count}
		</div>
	);
}

// connect.
function mapStateToProps(props, state) {
	props.count = state.count;
}

function mapDispatchToProps(props, dispatch) {
	props.upAction = function () {
		dispatch(new Action('addCount', {
			incAmount: 1
		}));
	};
};

const TestContainer = connect(
	TestComponent,
	mapStateToProps,
	mapDispatchToProps
);

// Top level render.
Inferno.render(
	<Provider store={store}>
		<TestContainer />
	</Provider>,
	document.getElementById('root')
);

Development

Installation

~/project/:

  • npm install

Build

  • npm run build

Benchmarking

  • npm run benchmark

Test

  • npm run test

Deploy

  • npm run deploy

License

The MIT License (MIT)

Copyright (c) 2016 John Pittman

Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:

The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.

THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.

3.0.8

7 years ago

3.0.7

7 years ago

3.0.6

7 years ago

3.0.5

7 years ago

3.0.4

7 years ago

3.0.3

7 years ago

3.0.2

7 years ago

3.0.1

7 years ago

3.0.0

7 years ago

2.0.0

7 years ago

1.0.2

7 years ago

1.0.1

7 years ago

1.0.0

7 years ago