Giter Club home page Giter Club logo

timelanecombine's Introduction

Timelane + Combine

TimelaneCombine

TimelaneCombine provides a Combine bindings for profiling Combine code with the Timelane Instrument.

Timelane Instrument

Table of Contens:

Usage

Import the TimelaneCombine framework in your code:

import TimelaneCombine

Use the lane(_) operator to profile a subscription via the TimelaneInstrument. Insert lane(_) at the precise spot in your code you'd like to profile like so:

downloadImage(at: url).
  .lane("Download: \(url.path)")
  .assign(to: \.image, on: myImageView)

Then profile your project by clicking Product > Profile in Xcode's main menu.

Select the Timelane Instrument template:

Timelane Instrument Template

Inspect your subscriptions on the timeline:

Timelane Live Recording

For a more detailed walkthrough go to http://timelane.tools.

Reference

lane(_:filter:)

Use lane("Lane name") to send data to both the subscriptions and events lanes in the Timelane Instrument.

lane("Lane name", filter: [.subscriptions]) sends begin/completion events to the Subscriptions lane. Use this syntax if you only want to observe concurrent subscriptions.

lane("Lane name", filter: [.events]) sends events and values to the Events lane. Use this filter if you are only interested in values a subscription would emit (e.g. for example subjects).

Additionally you can transform the values logged in Timelane by using the optional transformValue trailing closure:

lane("Lane name") { value in
  return "Value: \(value)"
}

In case you are using @Published you can easily log that subscription to Timelane by using replacing it with:

@PublishedOnLane("My Lane") var property: String

Installation

Swift Package Manager

I . Automatically in Xcode:

  • Click File > Swift Packages > Add Package Dependency...
  • Use the package URL https://github.com/icanzilb/TimelaneCombine to add TimelaneCombine to your project.

II . Manually in your Package.swift file add:

.package(url: "https://github.com/icanzilb/TimelaneCombine", .from("1.0.4"))

CocoaPods

CocoaPods is a dependency manager for Cocoa projects. For usage and installation instructions, visit their website. To integrate TimelaneCombine into your Xcode project using CocoaPods, specify it in your Podfile:

pod 'TimelaneCombine', '~> 1.0.4'

Carthage

Carthage is a decentralized dependency manager that builds your dependencies and provides you with binary frameworks. To integrate TimelaneCombine into your Xcode project using Carthage, specify it in your Cartfile:

github "icanzilb/TimelaneCombine" "1.0.4"

Demo

The Timelane package contains a demo app at: https://github.com/icanzilb/timelane.

License

Copyright (c) Marin Todorov 2020 This package is provided under the MIT License.

timelanecombine's People

Contributors

icanzilb avatar karimebrahemabdelaziz avatar donnywals avatar dnkoutso avatar szymonmrozek avatar freak4pc avatar

Stargazers

Carabineiro avatar

Watchers

Carabineiro avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.