8 Kasım 2016 Salı

Redux store fonksiyonları

The store binds together the three principles of redux. It holds the current applications state object. It lets you dispatch actions. When you create it, you need to specify the reducer that tells how state is updated with actions.

The store has three important methods.
The first method of store is "getState". It retrieves the current state of the redux store.
The second and the most commonly used store method is called "dispatch". And it lets you dispatch actions that changes the state of your application.
Third redux store method is called "subscribe". It lets you register a callback that the redux store will call anytime an action has been dispatched.



Store, redux’ın üç prensibini birleştirir. Uygulamanın state objesini tutar. Action’ları dispatch eder (dağıtır). Store’u oluştururken state’lerin action’larla nasıl güncelleneceği belirtilmelidir. (createStore function’ına parametre olarak reducer verilmelidir.)

Store’un 3 önemli yöntemi/metodu/fonksiyonu vardır.
İlki “getState”tir. Redux store’unun mevcuttaki state’ini getirir.
İkincisi ve en çok kullanılanı “dispatch”tir. Uygulamadaki state’leri değiştirecek action’ları dağıtır.
Üçüncüsü “subscribe”dır. Store’a bir callback ekler. Bir action çalıştığında redux store tarafında çağrılır.

ve devamındaki videolar.

Hiç yorum yok :

Yorum Gönder