Closed mokr closed 4 years ago
You know about https://github.com/deg/iron right?
@mokr Yes, we describe this approach in the re-frame docs.
But I don't want to create duplicates in the official re-frame API. There should only be one way to do something. It is then up to others to add whatever further layers they want.
If I had my time over again, I would change dispatch
to emit
because it is shorter. But at this point stability is more important than any little tweaks like that.
Closing.
The code I would like to see added to re-frame.core:
These are just convenience functions, but I find myself using them all the time. The only drawback is that I always have to first add them to a utils namespace and then require that namespace virtually everywhere. It would be great to just get them from re-frame itself.
I do understand that not everyone's preferred shorthand can be added to the project, but <sub is already mentioned in the doc string of subscribe, it's short and helps avoid forgetting to deref. >evt is just as short and the natural counterpart.
If forced to come up with a con: it could maybe be confused with naming conventions seen used for core.async.
Unless I'm not mistaken the idea was introduced in this lambdaisland blog