rniemeyer / knockout-postbox

A small library that uses Knockout's native pub/sub capabilities to facilitate decoupled communication between separate view models or components.
MIT License
350 stars 55 forks source link

Allow initializing to the latest value when using postbox.subscribe #17

Closed jakeatoms closed 11 years ago

jakeatoms commented 11 years ago

Can now pass initializeWithLatestValue as either the 4th or 3rd argument in postbox.subscribe. If the value is true, then the callback is executed before the function returns. I also updated the readme to reflect the new option.

Please let me know if I missed anything or if you think there's a better way to handle it.

rniemeyer commented 11 years ago

@jakeadams - thanks I will take a look at this and try to get it merged in and see if there are any additional tweaks to be made to it. Thank you for updating tests and docs. That is helpful.

rniemeyer commented 11 years ago

merged.