Skip to content

V2 Documentation Content Outline Brainstorming

Kevin Malakoff edited this page Dec 19, 2015 · 11 revisions

Background and Fundamentals

  • Philosophy, terminology, key concepts, benefits

  • Amazing Examples - demonstrate the the advantages / differences

  • How does it work - link to blog post

  • State

    • Building Blocks - observable, computed, reaction (?), action
    • Types - values, arrays, maps, sets
    • Examples - how to build collections of state (POJS, ES5, Decorators, Typed)
    • Helpers - peek, untracked, autorun, autorunAsync, autorunUntil

React Design Patterns

  • UI and Domain Stores (from current docs)
    • Explain how most state is outside the components
    • Show how state is loaded asynchronously
  • React Components
    • making them observers and explaining how to pass state to them (eg. is all state in global stores? is it better to use props / context / singletons?)

Design Patterns

  • Transactions
  • Transformations
    • describe how they work: in which situations are they useful, how to manage lifecycles of generated objects
    • how to register dependencies (and where not to)
  • Using with 'set' to implement actions
  • Code Reuse
    • Mixins
    • Reusable stores
  • Lifecycle Management
    • Computed state

Pitfalls and Common Solutions

  • Watching for a value change and cascading updates - for example, the user clicks on a list item, the item's isActive property is set, and you want to update the the UI Store without creating a cycle
  • Asynchronous data fetching - for example, using autorun to watch for a change, fetch a value from the server, then updating an observable. Is there a way to do this with asynchronous computed values? what about if a second change occurs mid-fetch?
  • Multiple transformation - I think the API currently only supports a single transformation, but maybe needs to be expanded (eg. one per transformation instance)
  • How to avoid untracked

Tips and Tricks / Cool Stuff

  • Debugging
  • Using the debugging tools

Upgrading Guide to V2

Renaming

  • autorun -> reactive (?)

Deprecations

  • observable (type) - show that it can be replaced with 'extend' and / or decorators
  • observable (value) - show that it can be replaced with 'extend' and / or decorators
  • modifiers (asFlat, asReference, asStructure) - show that they can be solved with 'extend' and non-recursive observables...hopefully!

Clone this wiki locally