Skip to content

Commit

Permalink
add istracking
Browse files Browse the repository at this point in the history
  • Loading branch information
josePereiro committed May 11, 2022
1 parent 11f68a3 commit cfcf6c7
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 1 deletion.
1 change: 1 addition & 0 deletions src/AbstractEvent.jl
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,7 @@ update!(e::AbstractEvent, args...) = error("Method `update!(e::$(typeof(e)), arg
reset!(e::AbstractEvent, args...) = error("Method `reset!(e::$(typeof(e)), args...)` not defined!")
trigger(e::AbstractEvent, old_state, new_state) = error("Method `trigger(e::$(typeof(e)), old_state, new_state)` not defined!")
states(e::AbstractEvent) = error("Method `states(e::$(typeof(e)))::AbstractDict` not defined!")
istraking(e::AbstractEvent, key) = haskey(states(e), key)

## ------------------------------------------------------------------
Base.getindex(e::AbstractEvent, key) = getindex(states(e), key)
Expand Down
2 changes: 1 addition & 1 deletion src/EasyEvents.jl
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ module EasyEvents

include("AbstractEvent.jl")
export AbstractEvent
export old_state, new_state, update!, reset!, trigger, states
export old_state, new_state, update!, reset!, trigger, states, istraking
export has_event, has_event!, on_event, on_event!

include("CustomEvent.jl")
Expand Down

0 comments on commit cfcf6c7

Please sign in to comment.