随笔分类 - React
摘要:It is time to add new entries to the wishlist. We will achieve this by reusing forms and models we've built so far. In this lesson you will learn: MST
阅读全文
摘要:In this lesson we will dive a bit more into the tree semantics of MST. In this lesson you will learn: Actions can only modify their own subtree The us
阅读全文
摘要:We will expand our UI, and give the user the possibility to edit his wishlist. We will use the earlier defined actions. We also will use model clones
阅读全文
摘要:If you try to use CSS Modules in TypeScript the same way you would use them in JavaScript, with webpack’s css-loader, you’ll see an error: ”TS2307: Ca
阅读全文
摘要:In this lesson we will refactor an existing UI update from a typical loading approach to an optimistic UI updateapproach to give our users a faster, m
阅读全文
摘要:React is great for diffing between Virtual-DOM and rendering it to the dom. It also offers a naïve solution for diffing state in terms of setState. Ho
阅读全文
摘要:In React, when you want to set the state which calculation depends on the current state, using an object can lead to state inconsistency. This is due
阅读全文
摘要:This lesson takes the concept of render props and migrates it over to streaming props by keeping the same example and simple refactoring the Togglecom
阅读全文
摘要:If you hard-code a stream of props to target a specific prop, it becomes impossible to reuse that stream with any other components. Configuring your p
阅读全文
摘要:Functions created with mapPropsStream canned be composed together to build up powerful streams. Bring in the compose helper from Recompose then simply
阅读全文
摘要:Rather than using Components to push streams into other Components, mapPropsStream allows you to create functions that can wrap components to create s
阅读全文
摘要:You can decouple the parent stream Component from the mapped React Component by using props.children instead. This process involves mapping the stream
阅读全文
摘要:Combining input streams then using scan to track the results is a common scenario when coding with streams. This lesson walks you through setting up t
阅读全文
摘要:Events are the beginning of most every stream. Recompose provides a createEventHandler function to help your create handler and stream pairs. Once the
阅读全文
摘要:Loading data using RxJS is simple using Observable.ajax. This lesson shows you how to take the ajax response and pass it along the stream to use as pr
阅读全文
摘要:When you declare your Component and Props in JSX, you can pass those props along to your RxJS stream. This is typically done using switchMap or combin
阅读全文
摘要:Recompose provides helper functions to stream props using an Observable library of your choice into React. This lesson shows you how to configure Reco
阅读全文
摘要:When making a reusable component, you'll find that people often like to have the API they're most familiar with, so in this lesson we'll recreate the
阅读全文
摘要:If you have state that needs to exist throughout your application, then you may find yourself passing props all over the application and even "drillin
阅读全文
摘要:Sometimes users of your component want to have more control over what the internal state is. In this lesson we'll learn how to allow users to control
阅读全文