Coder Social home page Coder Social logo

react-rails-alt's Introduction

react-rails-alt

DEMO APP

This is demonstrates an app working with Rails, React.js, and Alt.

Dependencies

Implementation

ES6 Harmony

ES6 Harmony support must be enabled: https://github.com/reactjs/react-rails#jsx

Some notable ES2015 features are missing, like const and let.

NOTE: if you config after the Asset Pipeline has its way with your components, you'll need to run bin/rake assets:clean or rm -vfr tmp/cache to get things working again.

Alt instantiation

Make sure to instantiate alt before loading stores, actions, etc.

I did this with the following in application.js:

...
//= require_self
//= require_tree .

var alt = new Alt();

Alt and avoiding Modules

If you want to avoid adding a module system, you'll need to wrap Alt examples in an IIFE. If the Alt docs read something like this:

class NameActions = { ... }

module.exports = alt.createActions(NameActions);

You'll write something like this:

(() => {
  class NameActions { ... }

  this.NameActions = alt.createActions(NameActions);
})();

NOTE: if you want ES6 syntax available in these files, you'll need to append .jsx to the file name. This is a little kludgy but will allow you to work with the gems you already have installed.

react-rails-alt's People

Contributors

chantastic avatar

Watchers

James Cloos avatar Aregbede Ayomide avatar

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.