Skip to content

Commit

Permalink
Update documentation
Browse files Browse the repository at this point in the history
  • Loading branch information
Qata committed Dec 5, 2016
1 parent 9d48edb commit 4bebb4c
Show file tree
Hide file tree
Showing 7 changed files with 31 additions and 53 deletions.
51 changes: 18 additions & 33 deletions .jazzy.json
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
{
"xcodebuild_arguments": ["-project", "ReSwift.xcodeproj", "-scheme", "ReSwift-macOS"],
"swift_version": "2.2",
"xcodebuild_arguments": ["-project", "ReactiveReSwift.xcodeproj", "-scheme", "ReactiveReSwift-macOS"],
"swift_version": "3.0.1",
"author": "ReSwift",
"author_url": "https://github.com/ReSwift/ReSwift",
"module": "ReSwift",
"author_url": "https://github.com/ReSwift/ReactiveReSwift",
"module": "ReactiveReSwift",
"readme": "Docs/tmp/compile/README.md",
"theme": "Docs/jazzy-theme/",

Expand All @@ -13,13 +13,11 @@
"custom_categories": [{
"name": "Documentation",
"children": [
"About ReSwift",
"Why ReSwift",
"About ReactiveReSwift",
"Why ReactiveReSwift",
"Getting Started Guide",
"Installation",
"Checking out Source Code",
"Demo",
"Extensions",
"Reactive Extensions",
"Example Projects",
"Contributing",
"Credits",
Expand All @@ -28,43 +26,30 @@
"License"
]
}, {
"name": "Stores",
"name": "Core",
"children": [
"Store",
"StoreType",
"StoreSubscriber",
"AnyStoreSubscriber"
]
}, {
"name": "State",
"children": [
"StateType"
]
}, {
"name": "Actions",
"children": [
"StateType",
"Action",
"StandardAction",
"StandardActionConvertible",
"ReSwiftInit"
]
}, {
"name": "Reducers",
"children": [
"Reducer",
"AnyReducer",
"CombinedReducer"
"Middleware"
]
}, {
"name": "Utilities",
"name": "Reactive",
"children": [
"Coding"
"StreamType",
"ObservablePropertyType",
"SubscriptionReferenceType",
"ObservableProperty",
"ObservablePropertySubscriptionReference",
"SubscriptionReferenceBag"
]
}],

"string-replacements": {
"Docs/img": "img",
"http://reswift.github.io/ReSwift/master/getting-started-guide.html": "getting-started-guide.html",
"http://reswift.github.io/ReactiveReSwift/master/getting-started-guide.html": "getting-started-guide.html",
"#contributing": "contributing.html"
}
}
2 changes: 1 addition & 1 deletion .scripts/doc-preprocessor
Original file line number Diff line number Diff line change
Expand Up @@ -98,7 +98,7 @@ if jazzy_conf['string-replacements']
end
end

version = `cat ReSwift.podspec| grep "version " | cut -d '"' -f 2`.strip
version = `/usr/libexec/PlistBuddy -c "Print CFBundleShortVersionString" ReactiveReSwift/Info.plist`.strip
if version
result = result.sub '{{version}}', version
end
Expand Down
10 changes: 4 additions & 6 deletions .scripts/generate-docs
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ fi
# ----- Configuration

ORGANISATION=ReSwift
NAME=ReSwift
NAME=ReactiveReSwift
TMP=Docs/tmp
GITHUB=https://github.com/$ORGANISATION/$NAME
URL=http://$ORGANISATION.github.io/$NAME
Expand All @@ -41,12 +41,10 @@ mkdir -p $TMP/{compile,docs,api}
cp Docs/*.md $TMP/api/

# Split the README into sections
$PREPROC README.md "$TMP/docs/About ReSwift.md" --section "About ReSwift" --title "About ReSwift"
$PREPROC README.md "$TMP/docs/Why ReSwift.md" --section "Why ReSwift?" --title "Why ReSwift?"
$PREPROC README.md "$TMP/docs/About ReactiveReSwift.md" --section "About ReactiveReSwift" --title "About ReactiveReSwift"
$PREPROC README.md "$TMP/docs/Why ReactiveReSwift.md" --section "Why ReactiveReSwift?" --title "Why ReactiveReSwift?"
$PREPROC README.md "$TMP/docs/Installation.md" --section "Installation" --title "Installation"
$PREPROC README.md "$TMP/docs/Checking out Source Code.md" --section "Checking out Source Code" --title "Checking out Source Code"
$PREPROC README.md "$TMP/docs/Demo.md" --section "Demo" --title "Demo"
$PREPROC README.md "$TMP/docs/Extensions.md" --section "Extensions" --title "Extensions"
$PREPROC README.md "$TMP/docs/Reactive Extensions.md" --section "Reactive Extensions" --title "Reactive Extensions"
$PREPROC README.md "$TMP/docs/Example Projects.md" --section "Example Projects" --title "Example Projects"
$PREPROC README.md "$TMP/docs/Credits.md" --section "Credits" --title "Credits"
$PREPROC README.md "$TMP/docs/Get in touch.md" --section "Get in touch" --title "Get in touch"
Expand Down
2 changes: 1 addition & 1 deletion .scripts/update-gh-pages
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ fi
# ----- Configuration

ORGANISATION=ReSwift
NAME=ReSwift
NAME=ReactiveReSwift
BRANCH=$([ "$TRAVIS_BRANCH" == "" ] && echo "master" || echo "$TRAVIS_BRANCH")
SHA=`git rev-parse --verify HEAD --short`
REPO=`git config remote.origin.url`
Expand Down
10 changes: 3 additions & 7 deletions Docs/State.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,16 +2,12 @@ The application state is defined in a single data structure which should be a `s

The state `struct` should store your entire application state, that includes the UI state, the navigation state and the state of your model layer.

Here's an example of a state `struct` as defined in the [Counter Example](https://github.com/ReSwift/CounterExample):
Here's an example of a state `struct` as defined in the [Reactive Counter Example](https://github.com/Qata/ReactiveCounterExample):

```swift
struct AppState: StateType, HasNavigationState {
struct AppState: StateType {
var counter: Int = 0
var navigationState = NavigationState()
}
```

There are multiple things to note:

1. Your app state `struct` needs to conform to the `StateType` protocol, currently this is just a marker protocol, but we will likely add requirements (such as the ability to [serialize the state](https://github.com/ReSwift/ReSwift/issues/3)) before v1.0.
2. If you are including `SwiftRouter` in your project, your app state needs to conform to the `HasNavigationState` protocol. This means you need to add a property called `navigationState` to your state `struct`. This is the sub-state the router will use to store the current route.
Your app state `struct` needs to conform to the `StateType` protocol.
4 changes: 2 additions & 2 deletions ReactiveReSwift.xcodeproj/project.pbxproj
Original file line number Diff line number Diff line change
Expand Up @@ -1047,7 +1047,7 @@
INFOPLIST_FILE = ReactiveReSwift/Info.plist;
INSTALL_PATH = "$(LOCAL_LIBRARY_DIR)/Frameworks";
LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks @loader_path/Frameworks";
PRODUCT_BUNDLE_IDENTIFIER = reswift.github.io.ReSwiftFRP;
PRODUCT_BUNDLE_IDENTIFIER = reswift.github.io.ReactiveReSwift;
PRODUCT_NAME = ReactiveReSwift;
SKIP_INSTALL = YES;
SWIFT_OPTIMIZATION_LEVEL = "-Onone";
Expand All @@ -1066,7 +1066,7 @@
INFOPLIST_FILE = ReactiveReSwift/Info.plist;
INSTALL_PATH = "$(LOCAL_LIBRARY_DIR)/Frameworks";
LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks @loader_path/Frameworks";
PRODUCT_BUNDLE_IDENTIFIER = reswift.github.io.ReSwiftFRP;
PRODUCT_BUNDLE_IDENTIFIER = reswift.github.io.ReactiveReSwift;
PRODUCT_NAME = ReactiveReSwift;
SKIP_INSTALL = YES;
SWIFT_OPTIMIZATION_LEVEL = "-Owholemodule";
Expand Down
5 changes: 2 additions & 3 deletions ReactiveReSwift/CoreTypes/Store.swift
Original file line number Diff line number Diff line change
Expand Up @@ -11,9 +11,8 @@ import Foundation
/**
This class is the default implementation of the `Store` protocol. You will use this
store in most of your applications. You shouldn't need to implement your own store.
You initialize the store with a reducer and an initial application state. If your app has multiple
reducers you can combine them by initializng a `CombinedReducer` with all of your reducers as
arguments.
You initialize the store with a reducer and an initial application state,
contained within an observable.
*/

public class Store<ObservableProperty: ObservablePropertyType>: StoreType where ObservableProperty.ValueType: StateType {
Expand Down

0 comments on commit 4bebb4c

Please sign in to comment.