You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I was wondering is was a good idea extend the subscribe to subscribe to topics strings like PubSub, and add a publish method that could trigger the callback.
The text was updated successfully, but these errors were encountered:
knockout-decorators already have same concept — @event decorator. It also uses ko.subscribable() under the hood. The key difference from knockout postbox that events are strongly typed:
importeventsfrom"./events";subscribe(events.first,()=>{// do something});subscribe(events.second,(word,index)=>{// TypeScript infers that typeof word === "sting"// and typeof index === number;console.log(word.charAt(index));})
I was wondering is was a good idea extend the subscribe to subscribe to topics strings like PubSub, and add a publish method that could trigger the callback.
The text was updated successfully, but these errors were encountered: