Skip to content
This repository has been archived by the owner on May 18, 2019. It is now read-only.
/ MXPLib Public archive

A project to test out Swift features

License

Notifications You must be signed in to change notification settings

mxpr/MXPLib

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

4 Commits
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

MXPLib

A swift framework with various utilities and components

Catalog

KeyedCallbacks

A scoped callback management utility.

Usage:

import MXPLib

let keyedCallbacks = KeyedCallbacks<String>()

let handle1 = keyedCallbacks.register("key1") { print(">> \($0)") }

do {
    let handle2 = keyedCallbacks.register("key1") { print("## \($0)") }
    
    keyedCallbacks.performCallbacksForKey("key1", withParameters: "hello")
    // prints
    //
    //     >> hello
    //     ## hello
}

keyedCallbacks.performCallbacksForKey("key1", withParameters: "world")
// prints
//
//     >> world

About

A project to test out Swift features

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published