Open alias-r opened 4 years ago
The best I can do is:
switch(permission){
| permission when permission == Permission.default => 1
| permission when permission == Permission.denied => 2
| permission when permission == Permission. granted => 3
}
@alias-r It should end something like the commit so you can switch on it. However locally this is unboxing to denied
so I'll take a peek further later.
https://github.com/DivertiseAsia/bs-service-worker/commit/c13f183cabeb0a7d76abb54887bf50f043bef3ac probably do no require js converter. The recent implementation of BuckleScript translates record directly to Js obj.
Making permission becomes a module type interface is quite cool. Besides that, I don't quite see the real benefit as it cannot be used against pattern matching.
e.g. you cannot do this