indiamos / bookalatorJS

A web-based tool for exploring texts. Built with Node, Express, Postgres, Sequelize, React, Redux

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

FEAT(mvp): Set up the redux store

indiamos opened this issue · comments

commented

initialState = {
comparisonSet1: [],
comparisonSet2: [],
currentUser: {
userId: null,
isAdmin: false
},
selectedWord: ''
}

Each comparison set is an array of books selected by the user (the interface will start with allowing just one book each, though, for mvp); what is actually stored in this array? bookId? a book object that includes the metadata and word list(s)?

Should selectedWord be the word string itself, or should all words be stored in their own model, which might include an array of IDs of all the books it appears in, maybe all the sentences it appears in, and instance methods for getting things like the word’s Wordnik URL?

Reducers

fetchWord
fetchBook

commented

Revised initial state:

initialState = {
comparisonSet1: [],
comparisonSet2: [],
currentUser: {
userId: null,
isAdmin: false
},
selectedWord: '',
selectedBook: {}
}