Skip to content

Commit

Permalink
feat(immutable): added immutable reducer and selectors
Browse files Browse the repository at this point in the history
  • Loading branch information
Gitlab-CI committed Nov 23, 2018
1 parent 764b17f commit a82159e
Show file tree
Hide file tree
Showing 6 changed files with 34 additions and 15 deletions.
4 changes: 2 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
[![Build Status](https://travis-ci.org/bootstrap-styled/saga.svg?branch=master)](https://travis-ci.org/bootstrap-styled/saga) [![npm Version](https://img.shields.io/npm/v/@bootstrap-styled/saga.svg?style=flat)](https://www.npmjs.com/package/@bootstrap-styled/saga) [![License](https://img.shields.io/npm/l/@bootstrap-styled/saga.svg?style=flat)](https://www.npmjs.com/package/@bootstrap-styled/saga) [![NPM monthly downloads](https://img.shields.io/npm/dm/@bootstrap-styled/saga.svg?style=flat)](https://npmjs.org/package/@bootstrap-styled/saga) [![NPM total downloads](https://img.shields.io/npm/dt/@bootstrap-styled/saga.svg?style=flat)](https://npmjs.org/package/@bootstrap-styled/saga) [![npm Version](https://img.shields.io/node/v/@bootstrap-styled/saga.svg?style=flat)](https://www.npmjs.com/package/@bootstrap-styled/saga) [![Module formats](https://img.shields.io/badge/module%20formats-umd%2C%20cjs%2C%20esm-green.svg?style=flat)](https://www.npmjs.com/package/@bootstrap-styled/saga)
[![Coverage](https://sonarcloud.io/api/project_badges/measure?project=com.github.bootstrap-styled.saga&metric=coverage)](https://sonarcloud.io/dashboard?id=com.github.bootstrap-styled.saga) [![Quality gate status](https://sonarcloud.io/api/project_badges/measure?project=com.github.bootstrap-styled.saga&metric=alert_status)](https://sonarcloud.io/dashboard?id=com.github.bootstrap-styled.saga)

Bootstrap Styled saga will help you fetch theme to your bootstrap-styled-redux ConnectedBootstrapProvider
Bootstrap Styled Saga help you pull themes from a server


## Table of Contents
Expand All @@ -22,8 +22,8 @@ Read [saga documentation](https://bootstrap-styled.github.io/saga).
## Contributors

We are grateful to the contributors for their ideas and collaboration:
- Dimitri Kopriwa

- Dimitri Kopriwa

## Contributing

Expand Down
23 changes: 12 additions & 11 deletions docs/configuration.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,20 +4,21 @@ Start the the saga in your application, for example:
import React, { Component } from 'react';
import Provider from 'react-redux/lib/components/Provider';
import PropTypes from 'prop-types';
import { createStore, applyMiddleware, compose } from 'redux';
import { createStore, applyMiddleware, compose, combineReducers } from 'redux';
import createSagaMiddleware from 'redux-saga';
import ConnectedBootstrapProvider from '@bootstrap-styled/redux/lib/components/ConnectedBootstrapProvider';
import bsReduxSaga from '@bootstrap-styled/saga/lib/saga';

// use the combinedReducers if you don't have any from your app
import combinedReducers from '@bootstrap-styled/redux/lib/reducer';

// or import our asyncThemeReducer and combine it your self
// import asyncThemeReducer from '@bootstrap-styled/redux/lib/asyncThemeReducer';
import ConnectedBootstrapProvider from '@bootstrap-styled/redux/lib/ConnectedBootstrapProvider';
import bsReduxReducer from '@bootstrap-styled/redux/lib/reducer';
import bsSagaReducer from '$PACKAGE_NAME/lib/reducer';
import bsReduxSaga from '$PACKAGE_NAME/lib/saga';

// you provide this
import themeProvider, { theme } from './themeProvider';

const reducers = combineReducers({
'bs.redux': bsReduxReducer,
'bs.saga': bsSagaReducer,
});

const sagaMiddleware = createSagaMiddleware();
const bootstrapStyledSaga = bsReduxSaga(themeProvider, themes);

Expand All @@ -36,7 +37,7 @@ const enhancer = composeEnhancers(applyMiddleware(...middleware),
// other store enhancers if any
);

const store = createStore(combinedReducers, enhancer);
const store = createStore(reducers, enhancer);
sagaMiddleware.run(bootstrapStyledSaga);

function Wrapper(props) {
Expand All @@ -57,6 +58,6 @@ const sagaMiddleware = createSagaMiddleware();
const bootstrapStyledSaga = bsReduxSaga(themeProvider, themes);
```

It will provide your `themeProvider` and your availables values to our module.
It will provide your `themeProvider` and your available values to our module.

`themes` can be an array of `value` used as identifier, or a `themes` object.
8 changes: 7 additions & 1 deletion docs/introduction.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,9 @@
[![Build Status](https://travis-ci.org/bootstrap-styled/saga.svg?branch=master)](https://travis-ci.org/bootstrap-styled/saga) [![npm Version](https://img.shields.io/npm/v/@bootstrap-styled/saga.svg?style=flat)](https://www.npmjs.com/package/@bootstrap-styled/saga) [![License](https://img.shields.io/npm/l/@bootstrap-styled/saga.svg?style=flat)](https://www.npmjs.com/package/@bootstrap-styled/saga) [![npm Version](https://img.shields.io/node/v/@bootstrap-styled/saga.svg?style=flat)](https://www.npmjs.com/package/@bootstrap-styled/saga) [![Module formats](https://img.shields.io/badge/module%20formats-umd%2C%20cjs%2C%20esm-green.svg?style=flat)](https://www.npmjs.com/package/@bootstrap-styled/saga)

Bootstrap Styled saga will help you fetch theme to your bootstrap-styled-redux ConnectedBootstrapProvider
$PACKAGE_DESCRIPTION

## Features

- Fetch your theme from a theme server.
- Store all your Bootstrap Styled theme in one place with [@bootstrap-styled/redux](https://www.npmjs.com/package/@bootstrap-styled/redux).
- Support [redux-immutable](https://redux.js.org/recipes/usingimmutablejs).
8 changes: 8 additions & 0 deletions docs/server.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
**Use case:** Using a Bootstrap Styled theme customizer tools, you can view and edit themes.

This is useful to store your themes in database on the server.

This module is in charge of loading asynchronous theme from a server.



2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
{
"name": "@bootstrap-styled/saga",
"version": "0.0.0-development",
"description": "Bootstrap Styled saga will help you fetch theme to your bootstrap-styled-redux ConnectedBootstrapProvider",
"description": "Bootstrap Styled Saga help you pull themes from a server.",
"main": "lib/index.js",
"jsnext:main": "dist/@bootstrap-styled/saga.es.js",
"module": "dist/@bootstrap-styled/saga.es.js",
Expand Down
4 changes: 4 additions & 0 deletions styleguide/styleguide.ext.json
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,10 @@
"name": "Configuration",
"content": "docs/configuration.md"
},
{
"name": "Server",
"content": "docs/server.md"
},
{
"name": "Actions",
"content": "docs/actions.md"
Expand Down

0 comments on commit a82159e

Please sign in to comment.