Fixed #2631 - Changed initialState function declaration

Updated the docs on the state manager for a computed initialState function. Computed properties are deprecated for `create` methods and so the initialState function needs to be put inside an `extend` method before the state is created.