How to use mini-store - 2 common examples

To help you get started, we’ve selected a few mini-store examples, based on popular ways it is used in public projects.

Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.

github cmux / koot / packages / koot-component / components / layout / header / header.jsx View on Github external
import React, { Component } from 'react';
import PropTypes from 'prop-types';
import { connect } from 'mini-store';

@KootExtend({
    styles: require('./header.module.less'),
})
@connect((state) => ({
    isHide: state.isHide,
}))
class Header extends Component {

    static propTypes = {
        children: PropTypes.node 
    }

    element = undefined
    
    render() {
        const { isHide } = this.props;
        let translateY = 0;
        if( this.element ){
            translateY = isHide ? this.element.offsetHeight : 0;
        }
github cmux / koot / packages / koot-component / components / layout / content / content-inner.jsx View on Github external
import React, { Component } from 'react';
import PropTypes from 'prop-types';
import { connect } from 'mini-store';

@KootExtend({
    styles: require('./content-inner.module.less'),
})
@connect((state) => ({
    scrollOffset: state.scrollOffset,
    isHide: state.isHide
}))
class Content extends Component {

    static propTypes = {
        children: PropTypes.node
    }

    element = undefined;

    scroll = {
        scrolling: false,
        previousTop: 0,
        previousTime: 0,
    }

mini-store

[![Travis](https://img.shields.io/travis/yesmeck/mini-store.svg?style=flat-square)](https://travis-ci.org/yesmeck/mini-store)

MIT
Latest version published 4 years ago

Package Health Score

53 / 100
Full package analysis

Popular mini-store functions

Similar packages