trigger) but without all the extra overhead that jQuery has. JZ Publish/Subscribe has been updated to 1.4 and features a simple bug fix. You can also read about what to expect in 2.0, but I wouldn’t hold my breath for it.
In 1.3, I created a system that prevents some problems that may arise during publishing. Previously, if
publish executed a function that would create a subscription to or unsubscribe from the list that was currently being published to, it could cause an error or unexpected behavior. 1.3 fixed this by creating a status that was used to delay unsubscribing until publishing was finished.
That solution had 2 problems:
- I forgot to implement it for subscribing. It was only set up to work for unsubscribing.
- It was way more complicate than it needed to be.
Since then I’ve come up with a much simpler solution: copy the list being published to. This removes the list from the ability to be edited by
unsubscribe, so no changes will affect what gets published to until the next time
publish is called.
The next version of JZ Publish/Subscribe will receive a new feature: prioritization. I feel this feature is big enough to warrant a more substantial version number change, so it’ll be dubbed 2.0. I know this feature is used pretty rarely (but then again, so is this plugin), but there might be a few people who would really like it.
If you’re not sure what prioritization is, let me explain. When subscribing, you can specify an integer between 1 and 5 (3 would be default if none is supplied). When publishing, it’ll go through the priority numbers in order and publish to the subscriptions with priority 1 first, then priority 2, and so on. This way, even if you’re adding the subscription after many other subscriptions have been added, you can still make sure that subscription is published to before the others, unless all of the other subscriptions were also priority 1. This can be handy when one subscriber is dependent upon the computation done by a different subscriber.
I hope that the previous bugs haven’t been plaguing users of this plugin. I’ve rarely seen any application where that situation would arise, but it’s bound to happen somewhere. When it comes to updating to version 2, you might have to wait a while. As I mentioned, I don’t see many people looking for this feature, so this update is not high on my priority list. However, if I receive some comments to this post that tell me otherwise, I’ll bump up the priority on it. As always, God bless and happy coding!