callbacks
Version, currently 0.1.03 versions
- 0.2.0latestFeb 16, 2019
- 0.1.1not indexedMar 25, 2021
- 0.1.0not indexedMar 25, 2021
github.com/vladfaust/callbacks.cr
Expressive callbacks module for Crystal 🚉
Nothing has been indexed for 0.1.0 yet. The tag is recorded, its shard.yml has not been read, so the manifest and dependency list below are empty because they are unknown rather than because they are absent.
Installation
# Add this to your shard.yml
dependencies:
callbacks:
github: vladfaust/callbacks.cr
version: ~> 0.1.0Then run:
shards installshard.yml
No shard.yml has been indexed for 0.1.0. You can read it on the repository.
Dependencies
Unknown: the shard.yml for this version has not been read yet.
README
This README is the one indexed from the repository at its latest ref, not from the tag for this version.
Callbacks
An expressive callbacks module for Crystal.
Supporters
Thanks to all my patrons, I can build and support beautiful Open Source Software! 🙏
You can become a patron too in exchange of prioritized support and other perks
About
Callbacks defined with this module are properly inherited and run within a scope of the object itself (i.e. have an access to instance variables etc.).
Installation
Add this to your application's shard.yml:
dependencies:
callbacks:
github: vladfaust/callbacks.cr
version: ~> 0.2.0
This shard follows Semantic Versioning 2.0.0, so see releases and change the version accordingly.
Usage
require "callbacks"
class Foo
include Callbacks
def call
with_callbacks { puts "call" }
end
before do
puts "1"
end
before do
puts "2"
end
after do
puts "3"
end
after do
puts "4"
end
end
Foo.new.call
# 1, 2, call, 3, 4
Objects including Callbacks module can also be inherited preserving all callbacks:
class Bar < Foo
# Childrens before callbacks have higher precedence
before do
puts "5"
end
# Childrens after callbacks executed after parents'
after do
puts "6"
end
end
Bar.new.call
# 5, 1, 2, call, 3, 4, 6
Contributing
- Fork it (https://github.com/vladfaust/callbacks.cr/fork)
- Create your feature branch (
git checkout -b my-new-feature) - Commit your changes (
git commit -am 'Add some feature') - Push to the branch (
git push origin my-new-feature) - Create a new Pull Request
Contributors
- @vladfaust Vlad Faust - creator, maintainer
Documentation
Built from the current release. The first visit to a release nobody has asked for starts its build.
Links
This release
- Version
0.1.0- Tagged
- Mar 25, 2021
- Commit
0024907f8366- Indexed
- not yet
Dependents
Repository
github.com/vladfaust/callbacks.cr
Metadata
- Created
- Aug 16, 2026
- Updated
- Sep 23, 2026
- Synced
- Sep 23, 2026
- Versions
- 3