<commit_before>//
//  Action.swift
//  components-swift
//
//  Created by <NAME> on 10/9/17.
//  Copyright © 2017 <NAME>. All rights reserved.
//

import Foundation

/**
 Inspired by http://blog.scottlogic.com/2015/02/05/swift-events.html
 */

/**
 Actions provide a simple way for a child component to inform a parent component that something happened. For example:
 
 FooComponent
   -> ButtonComponent
 
 If FooComponent wants to know when the ButtonComponent is tapped, it can pass down an *action* which is received by
 the ButtonComponent in its props.
 
   ButtonComponent tapped -> call FooComponent's action
 
 Note that Action is generic, and provides the capacity for providing data to the callee. Here's an example:
 
 final class ButtonComponent: TypedComponent {
   typealias PropType = Action<UITouch>
 
   func somethingHappened(touch: UITouch) {
     self.props.send(touch)
   }
 }
 */
public class Action<Arg> {
  public init() {}
  public func send(_ argument: Arg) {
    // No-op
  }
}

/**
 Handler is a specialization of Action for a specific parent component. Handlers are constructed by parent components,
 but should never be exposed in props. Always put Actions in props instead, and callers will actually pass you a handler
 to that action instead.
 
 Usage:
 
 final class BarComponent: TypedComponent {
   typealias PropType = Void?
 
   func actionMethod(touch: UITouch) {} // When ButtonComponent sends its action, this method will be invoked
 
   func render() -> [Component] {
     return ButtonComponent( Handler(BarComponent.actionMethod) )
   }
 }
 */
public class Handler<Target: AnyObject, Arg>: Action<Arg> {
  let target: () -> Target?<commit_msg>Break the build to test CI<commit_after>//
//  Action.swift
//  components-swift
//
//  Created by <NAME> on 10/9/17.
//  Copyright © 2017 <NAME>. All rights reserved.
//

import Foundation

/**
 Inspired by http://blog.scottlogic.com/2015/02/05/swift-events.html
 */

/**
 Actions provide a simple way for a child component to inform a parent component that something happened. For example:
 
 FooComponent
   -> ButtonComponent
 
 If FooComponent wants to know when the ButtonComponent is tapped, it can pass down an *action* which is received by
 the ButtonComponent in its props.
 
   ButtonComponent tapped -> call FooComponent's action
 
 Note that Action is generic, and provides the capacity for providing data to the callee. Here's an example:
 
 final class ButtonComponent: TypedComponent {
   typealias PropType = Action<UITouch>
 
   func somethingHappened(touch: UITouch) {
     self.props.send(touch)
   }
 }
 */
public class Action<Arg> {
  public init() {}
  public func send(_ argument: Arg) {
    // No-op
    // Intentionall broken code to test CI:
    bla()
  }
}

/**
 Handler is a specialization of Action for a specific parent component. Handlers are constructed by parent components,
 but should never be exposed in props. Always put Actions in props instead, and callers will actually pass you a handler
 to that action instead.
 
 Usage:
 
 final class BarComponent: TypedComponent {
   typealias PropType = Void?
 
   func actionMethod(touch: UITouch) {} // When ButtonComponent sends its action, this method will be invoked
 
   func render() -> [Component] {
     return ButtonComponent( Handler(BarComponent.actionMethod) )
   }
 }
 */
public class Handler<Target: AnyObject, Arg>: Action<Arg> {
  let target: () -> Target?
{'fraction_non_alphanumeric': 0.0868933449578611, 'fraction_numerical': 0.00988084859052601, 'mean_word_length': 3.4585492227979273, 'pattern_counts': {'":': 0, '<': 15, '<?xml version=': 0, '>': 23, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '3286266', 'n_tokens_mistral': 1009, 'n_tokens_neox': 897, 'n_words': 389}