This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import React, {Component} from 'react' | |
import {Link} from 'react-router-dom' | |
export class MovieList extends Component { | |
constructor(props) { | |
super(props) | |
this.state = { |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
const redux = require('redux') | |
const createStore = redux.createStore | |
const initialState = { | |
posts : [] | |
} |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import React, {Component} from 'react' | |
import {connect} from 'react-redux' | |
class Counter extends Component { | |
constructor(props) { | |
super(props) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import Foundation | |
import UIKit | |
import Intents | |
import CoreSpotlight | |
import CoreServices | |
@IBAction func donate() { | |
// perform an actual order here | |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import { createStore, combineReducers } from 'redux' | |
const rootReducer = combineReducers({ | |
ctr : counterReducer, | |
res : resultReducer | |
}) | |
// map state to properties | |
const mapStateToProps = (state) => { |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// create a random location ;) | |
let location = CLLocation(latitude: 40.762428, longitude: -73.973794) | |
let placemark = CLPlacemark(location: location, name: "Your Mom's House", postalAddress: nil) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
let orderCoffeeIntent = OrderCoffeeIntent() | |
orderCoffeeIntent.setImage(INImage(named: "coffee.jpg"), forParameterNamed: \.coffeeName) | |
orderCoffeeIntent.coffeeName = coffeeName | |
orderCoffeeIntent.deliveryLocation = placemark |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
let interaction = INInteraction(intent: orderCoffeeIntent, response: nil) | |
interaction.donate { error in | |
if let error = error { | |
print(error.localizedDescription) | |
} | |
} |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import Intents | |
class IntentHandler: INExtension, OrderCoffeeIntentHandling { | |
func confirm(intent: OrderCoffeeIntent, completion: @escaping (OrderCoffeeIntentResponse) -> Void) { | |
completion(OrderCoffeeIntentResponse(code: .ready, userActivity: nil)) | |
} | |
func handle(intent: OrderCoffeeIntent, completion: @escaping (OrderCoffeeIntentResponse) -> Void) { |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import Foundation | |
import UIKit | |
// InvoiceView.swift | |
class InvoiceView :UIView { | |
@IBOutlet weak var coffeeNameLabel :UILabel! | |
@IBOutlet weak var deliveryLocationLabel :UILabel! | |
} |