August 2017
Beginner
374 pages
10h 41m
English
Next is the application state for posts. Posts have an author (a user), a title, text, creation date/timestamp, last updated date/timestamp, and a category. A single post object could look like this:
{
user: 'dan',
title: 'Test Post',
text: 'hello world!',
category: 'test',
created: 1491828725892,
updated: 1491828725892
}
In the application state, we have an array of these post objects. In other parts of the state, we reference posts by their unique ID. As you can see, the user property here references the user object we defined earlier by username.
Read now
Unlock full access