Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add 'global' helper to register events globally #42

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

lambdalisue
Copy link
Contributor

To solve #26. I create a 'global' helper which can register events globally like:

let s:events = {}

function! s:events.initialize() abort
  call themis#log('Initialize')
endfunction

function! s:events.before() abort
  call themis#log('Before')
endfunction

function! s:events.before_each() abort
  call themis#log('Before each')
endfunction

function! s:events.after_each() abort
  call themis#log('After each')
endfunction

function! s:events.after() abort
  call themis#log('After')
endfunction

function! s:events.finalize() abort
  call themis#log('Finalize')
endfunction

" Register global event
call themis#helper('global').with(s:events)

@thinca
Copy link
Owner

thinca commented Aug 25, 2016

すいませんがちょっと保留させてください。インターフェースがちょっとしっくり来ない…(主に with)。

@lambdalisue
Copy link
Contributor Author

Oh. 了解しました。

@lambdalisue
Copy link
Contributor Author

ping

@lambdalisue
Copy link
Contributor Author

これ

call themis#helper('global').use(s:events)

とかだとシックリきたりします?w

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants