New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add a Playground so you can play with Promises interactively #2

Merged
merged 3 commits into from Sep 15, 2016

Conversation

Projects
None yet
2 participants
@kelan
Contributor

kelan commented Sep 10, 2016

Changes to the Promise code:

Add a Playground so you can play with Promises interactively
Changes to the Promise code:
* Add `public` to everything so it's accessible from outside the module.
* Add some headerdoc (mostly copy/pasted from http://khanlou.com/2016/08/common-patterns-with-promises/)
@kelan

This comment has been minimized.

Show comment
Hide comment
@kelan

kelan Sep 10, 2016

Contributor

I've been playing with this project recently in a Playground, and thought it was a good example for including the playground with the project, as I talk about here.

Contributor

kelan commented Sep 10, 2016

I've been playing with this project recently in a Playground, and thought it was a good example for including the playground with the project, as I talk about here.

@kelan kelan referenced this pull request Sep 10, 2016

Closed

Convert to Swift 3 #3

Update README to mention the playground
Also add syntax highlighting to the code blocks, and a link to the A+ spec.
Show outdated Hide outdated Promise.playground/Pages/Basic Usage.xcplaygroundpage/Contents.swift
Show outdated Hide outdated Promise.playground/Pages/Common Patterns.xcplaygroundpage/Contents.swift
Show outdated Hide outdated Promise.playground/Pages/Common Patterns.xcplaygroundpage/Contents.swift
Show outdated Hide outdated Promise.playground/Pages/Common Patterns.xcplaygroundpage/Contents.swift
Show outdated Hide outdated Promise.playground/Pages/Common Patterns.xcplaygroundpage/Contents.swift
Show outdated Hide outdated Promise.playground/Pages/Common Patterns.xcplaygroundpage/Contents.swift
Show outdated Hide outdated Promise.playground/Pages/Common Patterns.xcplaygroundpage/Contents.swift
Show outdated Hide outdated Promise.playground/Pages/Common Patterns.xcplaygroundpage/Contents.swift
/// Wait for all the promises you give it to fulfill, and once they have, fulfill itself
/// with the array of all fulfilled values.
public static func all<T>(promises: [Promise<T>]) -> Promise<[T]> {

This comment has been minimized.

@khanlou

khanlou Sep 14, 2016

Owner

are these comments formatted such that they show up when the user option-clicks?

@khanlou

khanlou Sep 14, 2016

Owner

are these comments formatted such that they show up when the user option-clicks?

This comment has been minimized.

@kelan

kelan Sep 15, 2016

Contributor

Yeah, it's standard headerdoc for Swift code, and shows up when you option-click on the symbol in Xcode.

screen shot 2016-09-14 at 6 54 35 pm

@kelan

kelan Sep 15, 2016

Contributor

Yeah, it's standard headerdoc for Swift code, and shows up when you option-click on the symbol in Xcode.

screen shot 2016-09-14 at 6 54 35 pm

This comment has been minimized.

@khanlou

khanlou Sep 15, 2016

Owner

sweet!

@khanlou

khanlou Sep 15, 2016

Owner

sweet!

@kelan

This comment has been minimized.

Show comment
Hide comment
@kelan

kelan Sep 15, 2016

Contributor

Thanks for the feedback! I'll try to work on the style tweaks later tonight.

Contributor

kelan commented Sep 15, 2016

Thanks for the feedback! I'll try to work on the style tweaks later tonight.

@kelan

This comment has been minimized.

Show comment
Hide comment
@kelan

kelan Sep 15, 2016

Contributor

I think I got 'em all.

Contributor

kelan commented Sep 15, 2016

I think I got 'em all.

@khanlou khanlou merged commit 84393e2 into khanlou:master Sep 15, 2016

@kelan kelan deleted the kelan:playground branch Sep 15, 2016

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment