Skip to content

State Shape

Julian Knoche edited this page Feb 10, 2020 · 4 revisions

{

  entities: {
    transaction: {
      1: {
        id: 1,
        price: 256,
        numberOfShares: 3,
        stockId: 14555
        userId: 11,
      },
      2: {
        id: 2,
        price: 258,
        numberOfShares: 3,
        stockId: 14342
        userId: 13,
      },
      3: {
        id: 3,
        price: 222,
        numberOfShares: 3,
        stockId: 14233
        userId: 16,
      }
    },
    users: {
      11: {
        id: 11,
        username: "blue_macaw",
        transactionIds: [1, 3],        
      },
      25: {
        id: 25,
        username: "blue_toucan",
        transactionIds: [5, 8],        
      }
    },
    stocks: {
      10: {
        id: 10,
        exchange: NYSE
        ticker: AAPL
        companyName: Apple
      },
      11: {
        id: 11,
        exchange: NYSE
        ticker: AAPL
        companyName: Apple
      },
      12: {
        id: 12,
        exchange: NYSE
        ticker: AAPL
        companyName: Apple
      },
    },
    watchList: {
      10: {
        stockId: 10,
        price: 1,
      },
      11: {
        stockId: 11,
        price: 12,
      },
      12: {
        stockId: 12,
        price: 15,
      },
    }
  },
  ui: {
    loading: true/false
  },
  errors: {
    login: ["Incorrect username/password combination"]
  },
  session: { currentUserId: 25 }

}

Clone this wiki locally