Skip to content

Instantly share code, notes, and snippets.

View panvourtsis's full-sized avatar

Panagiotis Vourtsis panvourtsis

View GitHub Profile
import callApi from "../common/utils/apiCaller";
export const ADD_RATINGS = "ADD_RATINGS";
export function addRatings(ratings) {
return {
type: ADD_RATINGS,
ratings,
};
}
import { ADD_RATINGS } from "./RatingsActions";
const initialState = { list: [] };
const RatingsReducer = (state = initialState, action) => {
switch (action.type) {
case ADD_RATINGS :
return {
...state,
import React from "react";
import PropTypes from "prop-types";
function RatingsItem(props) {
return (
<div>
{props.rating.text}
</div>
);
}

Code directory structure

├── app - holds all the components
│   ├── common - is not a module of the app. This holds utils for the react app.
│   │   └── utils
│   ├── ratings
│   │   ├── components 
│   │   │   ├── RatingItem 
│   │   │   │   ├── RatingItem.js 

│ │ │ │ └── RatingItem.less

{
"dependencies": {
"ng-redux": "^3.4.0-beta.1",
"prop-types": "^15.5.10",
"react": "^15.5.4",
"react-dom": "^15.5.4",
"react-redux": "^5.0.5",
"react2angular": "^1.1.3",
"redux": "^3.6.0",
"redux-devtools": "^3.4.0",