Keeping Technical Books Useful as Implementation Details Change
Keep the explanation in the book and put dated implementation changes on a companion page. Each note should identify the affected passage, show what current primary documentation establishes and state whether the example has actually been run. That lets a useful method survive a change in API syntax without presenting an old code sample as current instructions.