Giter VIP home page Giter VIP logo

refraction-react's Introduction

Refraction React

Build Status npm version npm downloads Coverage Status

React bindings for refraction

Official React bindigs for Refraction. Subscribe, unsubscribe and publish to refraction automatically without doing it manually every time, small and performant!

Installation

You can install Refraction React using npm:

npm install --save refraction-react

If you aren't using npm in your project, you can include RefractionReact using UMD build in the dist folder with <script> tag.

Usage

You can import Refraction React in this way:

import { Provider, connect } from 'refraction-react';

Docs is available here

Examples

You can find an example of Refraction React in Refraction repository here. Alternatively, you can check awesome-refraction.

If you want to run examples, check out the instruction here.

Change Log

This project adheres to Semantic Versioning.
Every release, along with the migration instructions, is documented on the Github Releases page.

Authors

Matteo Basso

Adriano Buscema

Copyright and License

Copyright (c) 2016, Matteo Basso.

refraction-react source code is licensed under the MIT License.

refraction-react's People

Contributors

mbasso avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar

refraction-react's Issues

Improvement: API Doc about connect is not clear

In https://github.com/mbasso/refraction-react/blob/master/docs/api.md, It takes me quite a few minutes to understand the comments.

const InputContainer = connect({
  actions: {
    // <Input onChange={refraction.onInputChange} />
    // or if unavailable
    // <Input onChange={refraction.publish.bind(null, 'onInputChange')} />
    // will publish an event on input change
    onChange: 'onInputChange',
  },
  subscriptions: {
    // <Input value={payload} />
    // handle the event and set props.value equals to payload
    // only if is valid, set old value instead (not overwriting it)
    onInputChange: (param, props) => {
      const newProps = {};
      if (param.payload) {
        newProps.value = param.payload;
      }
      return newProps;
    },
  },
})(Input);

The comment in actions and subscriptions is actually counterpart manual coding, right?

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.