A
A
Alexey Nikiforov2015-08-19 14:34:17
React
Alexey Nikiforov, 2015-08-19 14:34:17

What is "data rehydration"?

Good afternoon.
In the process of learning React.js and Flux, this concept is often encountered. Can you briefly explain what it is? Google didn't help me much unfortunately.

Answer the question

In order to leave comments, you need to log in

2 answer(s)
Александр Петров, 2015-08-19
@Alexius

One of the useful features in React is the page prerender.
To render a page on the server, you need to get all the data that the page needs. Your data is stored in Stores.
We received the data on the server, rendered the pages, sent the markup ... And the data again needs to be received on the client.
It is much easier to do dehydration on the server (serialize all the necessary data), send them immediately to the client (along with markup) and do rehydration on the client (from the serialized data back to the stores or wherever you need).
As an example: yahoo/dispatcher  - 2 methods with the same names for each store.

Михаил Горячкин, 2015-08-19
@abaddon65

Ну если вкратце, то dehydrating это всего лишь навсего сохранение состояния вашего приложения в какой-либо объект. Соответственно rehydration это перезапись состояния вашего приложения или восстановление состояния приложения по входным данным. Применительно ко Flux архитектуре этим занимаются Stor-ы и Dispatcher. Первые хранят состояния ваших компонентов, второй отслеживает изменения.

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question