Skip to content

Using reducers

Sstobo edited this page Mar 20, 2018 · 5 revisions

import { getUser } from "../../redux/modules/userReducer";

import { getCompany } from "../../redux/modules/companyReducer";

import { getCompanyProjects } from "../../redux/modules/companyReducer";

import { getCompanyQuestions } from "../../redux/modules/companyReducer";

Examples of dispatches to fetch Firebase server data

componentDidMount() {

this.props.dispatch(getUser("WJTvKQHAwP9frwE46woO"));

this.props.dispatch(getCompany("IxTyhQSllwOPTG0u3qCF"));

this.props.dispatch(getCompanyProjects("IxTyhQSllwOPTG0u3qCF", "project1"));

componentDidMount() { this.props.dispatch(getCompanyQuestions("adobe", "photoshop")); } }

Fetch functions

User Guide: All functions take an ID. This is the hash generated by firebase.

The getProjects function takes a 'project number' ie: project1, project2 ect.

The getQuestions function takes a project number and a question number ie: question1, question2 ect

Clone this wiki locally