4.1.8 • Published 1 year ago

treble-gsm v4.1.8

Weekly downloads
49
License
MIT
Repository
github
Last release
1 year ago

npm version example workflow

Treble Global State Management

Treble is a Hook-based global state management container and library for React.js apps. It is inspired by a blog post by Luke Hall. Treble's goal is to provide a simple way to manage global state in your React app by providing an easy setup, little boilerplate, and a straight forward API.

Getting Started

Install Treble

npm install treble-gsm

or

yarn add treble-gsm

Create Treble Store

Create a Store.js file in your app. Example below.

import { createStore } from 'treble-gsm';

const Store = createStore([
    {
        action: 'updatePokemon',
        state: { pokemon: 'Mewtwo' }
    },
    {
        action: 'updatePokemonGame',
        state: { pokemonGame: 'Pokemon Red' }
    }
],/* optional parameters */);

export default Store;

Treble Container Component

Import the Treble container component and Store.js into your App.js or index.js and wrap it around the components you wish to have access to your store. Pass the Store into the Treble store prop. Your app now has global state management!

import  React  from  'react';
import  Treble  from  'treble-gsm';
import  Store  from  './_store';

const App = () => {
    return (
        <Treble store={Store}>
            {/* Components */}
        </Treble>
    );
}

export  default  App;

For more documentation visit the official website, get-treble-gsm.com.

4.1.8

1 year ago

4.0.7

1 year ago

4.0.1

1 year ago

4.0.0

3 years ago

3.0.6

3 years ago

3.0.5

3 years ago

3.0.4

3 years ago

3.0.3

4 years ago

3.0.2

4 years ago

3.0.1

4 years ago

3.0.0

4 years ago

2.2.0

4 years ago

2.1.1

4 years ago

2.1.4

4 years ago

2.1.5

4 years ago

2.1.0

4 years ago

2.0.0-beta.1

4 years ago

2.0.0-beta.0

4 years ago

1.3.0

4 years ago

1.3.0-beta.20

4 years ago

1.3.0-beta.17

4 years ago

1.3.0-beta.16

4 years ago

1.3.0-beta.15

4 years ago

1.3.0-beta.14

4 years ago

1.3.0-beta.11

4 years ago

1.3.0-beta.12

4 years ago

1.3.0-beta.13

4 years ago

1.3.0-beta.10

4 years ago

1.3.0-beta.9

4 years ago

1.3.0-beta.8

4 years ago

1.3.0-beta.6

4 years ago

1.3.0-beta.7

4 years ago

1.3.0-beta.4

4 years ago

1.3.0-beta.3

4 years ago

1.3.0-beta.2

4 years ago

1.3.0-beta.1

4 years ago

1.2.3

4 years ago

1.2.2

4 years ago

1.2.1

4 years ago

1.2.0

4 years ago

1.1.2

4 years ago

1.0.13

4 years ago

1.1.8

4 years ago

1.1.7

4 years ago

1.1.6

4 years ago

1.1.4

4 years ago

1.1.3

4 years ago

1.1.1

4 years ago

1.1.0

4 years ago

1.0.1

4 years ago

1.0.0

4 years ago