Improve Table of Contexts in various docs

This commit is contained in:
Mike Thompson 2016-12-29 11:05:15 +11:00
parent fcd0db5d32
commit 2a8e5dcfac
7 changed files with 50 additions and 58 deletions

View File

@ -20,32 +20,24 @@ In this tutorial, **we'll look at re-frame code**.
- [Namespace](#namespace)
- [Data Schema](#data-schema)
- [Events (domino 1)](#events-domino-1)
- [dispatch](#dispatch)
- [After dispatch](#after-dispatch)
- [Event Handlers (domino 2)](#event-handlers-domino-2)
- [reg-event-db](#reg-event-db)
- [:initialize](#initialize)
- [:timer](#timer)
- [:time-color-change](#time-color-change)
- [Effect Handlers (domino 3)](#effect-handlers-domino-3)
- [Subscription Handlers (domino 4)](#subscription-handlers-domino-4)
- [reg-sub](#reg-sub)
- [View Functions (domino 5)](#view-functions-domino-5)
- [Hiccup](#hiccup)
<!-- END doctoc generated TOC please keep comment here to allow auto update -->
## What Code?
This repo contains an example application called ["simple"](https://github.com/Day8/re-frame/tree/develop/examples/simple),
which has around 70 lines of code. We'll look at every line of [the file](https://github.com/Day8/re-frame/blob/develop/examples/simple/src/simple/core.cljs).
This repo contains an `/examples` application called ["simple"](https://github.com/Day8/re-frame/tree/develop/examples/simple),
which contains 70 lines of code. We'll look at every line of [the file](https://github.com/Day8/re-frame/blob/develop/examples/simple/src/simple/core.cljs).
This app:
- displays the current time in a nice big, colourful font
- provides a single text input field, into which you can type a hex colour code,
like "#CCC", used for the time display
Here's what it looks like:
When it is running, here's what it looks like:
![Example App image](../images/example_app.png)
@ -93,7 +85,7 @@ to your various handlers as required.
## Events (domino 1)
Events are data. You choose the format.
Events are data.
re-frame uses a vector
format for events. For example:
@ -107,14 +99,13 @@ associated with the event. The additional value above, `42`, is
presumably the id of the item to delete.
Here are some other example events:
```clj
[:admit-to-being-satoshi false]
[:dressing/put-pants-on "velour flares" {:method :left-leg-first :belt false}]
```
The `kind` of event is always a keyword, and for non-trivial
applications it tends to be namespaced.
The `kind` of event is a keyword, and for non-trivial
applications it will be namespaced.
**Rule**: events are pure data. No sneaky tricks like putting
callback functions on the wire. You know who you are.

View File

@ -9,19 +9,19 @@ to manage them in tests.
<!-- DON'T EDIT THIS SECTION, INSTEAD RE-RUN doctoc TO UPDATE -->
### Table Of Contents
- [What Are They?](#what-are-they)
- [An Example](#an-example)
- [How We Want It](#how-we-want-it)
- [Abracadabra](#abracadabra)
- [Which Interceptors?](#which-interceptors)
- [`inject-cofx`](#inject-cofx)
- [More `inject-cofx`](#more-inject-cofx)
- [Meet `reg-cofx`](#meet-reg-cofx)
- [Example Of `reg-cofx`](#example-of-reg-cofx)
- [Another Example Of `reg-cofx`](#another-example-of-reg-cofx)
- [Secret Interceptors](#secret-interceptors)
- [Testing](#testing)
- [The 5 Point Summary](#the-5-point-summary)
* [What Are They?](#what-are-they-)
* [An Example](#an-example)
* [How We Want It](#how-we-want-it)
* [Abracadabra](#abracadabra)
* [Which Interceptors?](#which-interceptors-)
* [`inject-cofx`](#-inject-cofx-)
* [More `inject-cofx`](#more--inject-cofx-)
* [Meet `reg-cofx`](#meet--reg-cofx-)
* [Example Of `reg-cofx`](#example-of--reg-cofx-)
* [Another Example Of `reg-cofx`](#another-example-of--reg-cofx-)
* [Secret Interceptors](#secret-interceptors)
* [Testing](#testing)
* [The 5 Point Summary](#the-5-point-summary)
<!-- END doctoc generated TOC please keep comment here to allow auto update -->

View File

@ -6,10 +6,6 @@ This tutorial explains how side effects are actioned,
how you can create your own side effects, and how you can
make side effects a noop in event replays.
> imperative programming is a big pile of do <br>
> &nbsp; &nbsp; -- @stuarthalloway
<!-- START doctoc generated TOC please keep comment here to allow auto update -->
<!-- DON'T EDIT THIS SECTION, INSTEAD RE-RUN doctoc TO UPDATE -->
### Table Of Contents

View File

@ -6,24 +6,22 @@ This is a tutorial on re-frame Interceptors. It explains exactly how events get
<!-- DON'T EDIT THIS SECTION, INSTEAD RE-RUN doctoc TO UPDATE -->
### Table Of Contents
- [Introduction](#introduction)
- [Interceptors](#interceptors)
- [Why Interceptors?](#why-interceptors)
- [What Do Interceptors Do?](#what-do-interceptors-do)
- [Wait, I know That Pattern!](#wait-i-know-that-pattern)
- [What's In The Pipeline?](#whats-in-the-pipeline)
- [Show Me](#show-me)
- [Handlers Are Interceptors Too](#handlers-are-interceptors-too)
- [Why Interceptors?](#why-interceptors-)
- [What Do Interceptors Do?](#what-do-interceptors-do-)
- [Wait, I know That Pattern!](#wait--i-know-that-pattern-)
- [What's In The Pipeline?](#what-s-in-the-pipeline-)
- [Show Me](#show-me)
- [Handlers Are Interceptors Too](#handlers-are-interceptors-too)
- [Executing A Chain](#executing-a-chain)
- [The Links Of The Chain](#the-links-of-the-chain)
- [What Is Context?](#what-is-context)
- [What Is Context?](#what-is-context-)
- [Self Modifying](#self-modifying)
- [Credit](#credit)
- [Write An Interceptor](#write-an-interceptor)
- [Wrapping Handlers](#wrapping-handlers)
- [Summary](#summary)
- [Appendix](#appendix)
- [The Builtin Interceptors](#the-builtin-interceptors)
- [The Built-in Interceptors](#the-built-in-interceptors)
<!-- END doctoc generated TOC please keep comment here to allow auto update -->

View File

@ -30,16 +30,18 @@ then those patterns will repeat themselves. <br>
<!-- START doctoc generated TOC please keep comment here to allow auto update -->
<!-- DON'T EDIT THIS SECTION, INSTEAD RE-RUN doctoc TO UPDATE -->
## Table Of Contents
### Table Of Contents
- [What is the problem?](#what-is-the-problem)
- [What is the problem?](#what-is-the-problem-)
- [Guiding Philosophy](#guiding-philosophy)
- [It does Event Sourcing](#it-does-event-sourcing)
- [It does a reduce](#it-does-a-reduce)
- [Derived Data All The Way Down](#derived-data-all-the-way-down)
- [It does FSM](#it-does-fsm)
- [Interconnections](#interconnections)
- [Full Stack](#full-stack)
- [What Of This Romance?](#what-of-this-romance)
- [What Of This Romance?](#what-of-this-romance-)
<!-- END doctoc generated TOC please keep comment here to allow auto update -->

View File

@ -3,18 +3,18 @@
## Table Of Contents
- [Subscribing to External Data](#subscribing-to-external-data)
- [There Can Be Only One!!](#there-can-be-only-one)
- [Components Don't Know, Don't Care](#components-dont-know-dont-care)
- [A 2nd Source](#a-2nd-source)
- [Via A Subscription](#via-a-subscription)
- [The Subscription Handler's Job](#the-subscription-handlers-job)
- [Some Code](#some-code)
- [Any Good?](#any-good)
- [Warning: Undo/Redo](#warning-undoredo)
- [Query De-duplication](#query-de-duplication)
- [Thanks To](#thanks-to)
- [The Alternative Approach](#the-alternative--approach)
- [What Not To Do](#what-not-to-do)
* [There Can Be Only One!!](#there-can-be-only-one--)
* [Components Don't Know, Don't Care](#components-don-t-know--don-t-care)
* [A 2nd Source](#a-2nd-source)
* [Via A Subscription](#via-a-subscription)
* [The Subscription Handler's Job](#the-subscription-handler-s-job)
* [Some Code](#some-code)
* [Any Good?](#any-good-)
* [Warning: Undo/Redo](#warning--undo-redo)
* [Query De-duplication](#query-de-duplication)
* [Thanks To](#thanks-to)
- [The Alternative Approach](#the-alternative-approach)
- [Absolutely Never Do This](#absolutely-never-do-this)
<!-- END doctoc generated TOC please keep comment here to allow auto update -->
@ -213,7 +213,7 @@ in `issue-items-query!` itself. You can
@nidu for his valuable review comments and insights
## The Alternative Approach
## The Alternative Approach
Event handlers do most of the heavy lifting within re-frame apps.

View File

@ -162,3 +162,8 @@ This feature shakes out nicely because re-frame has a data oriented design.
Previous: [Infographic](SubscriptionInfographic.md)&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
Up: [Index](README.md)&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
Next: [Flow Mechanics](SubscriptionFlow.md) &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
<!-- START doctoc generated TOC please keep comment here to allow auto update -->
<!-- DON'T EDIT THIS SECTION, INSTEAD RE-RUN doctoc TO UPDATE -->
<!-- END doctoc generated TOC please keep comment here to allow auto update -->