Skip to content

Commit

Permalink
Route: remove reference to IRouteView that doesn't exist and add some…
Browse files Browse the repository at this point in the history
… clarification about updateState
  • Loading branch information
joshtynjala committed Oct 14, 2024
1 parent 5e0f7f2 commit 48a7660
Showing 1 changed file with 11 additions and 10 deletions.
21 changes: 11 additions & 10 deletions src/feathers/controls/navigators/Route.hx
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,6 @@
package feathers.controls.navigators;

import feathers.utils.DisplayObjectFactory;
import feathers.core.IUIControl;
import feathers.data.RouteState;
import feathers.utils.AbstractDisplayObjectFactory;
import openfl.display.DisplayObject;
Expand All @@ -29,13 +28,11 @@ import openfl.events.Event;
Path patterns support _named parameters_ that start with a `:` colon
character. For example, the path pattern `/:foo/:bar` has named parameters
with the names "foo" and "bar". If the display object returned by the `Route` implements
the `IRouteView` interface, the name parameters are passsed to the view
for additional parsing.
Named parameters may be made optional by appending a `?` question mark
character. For example, the "foo" parameter is optional in the path pattern
`/baz/:foo?`, and it will also match "/baz" without the parameter.
with the names "foo" and "bar". Named parameters may be made optional by
appending a `?` question mark character. For example, the "foo" parameter i
optional in the path pattern `/baz/:foo?`, and it will also match "/baz"
without the parameter. To pass named parameters or other properties of the
route's state to its view, see the `Route.updateState` method.
If the path pattern is `null` or an empty string, it will always match.
Expand Down Expand Up @@ -136,14 +133,18 @@ class Route {
public var path:String;

/**
An optional function to customize the view before it is shown.
An optional function to customize the view before it is shown. Receives
a `RouteState` object, which contains named parameters, URL variables,
history state, and optional, custom data saved with `Route.saveData`.
@since 1.0.0
**/
public dynamic function updateState(view:Dynamic, routeState:RouteState):Void {}

/**
An optional function to save the view's data before navigating away.
An optional function to save the view's data before navigating away. The
data may be restored later when returning to the view by providing a
custom `Route.updateState`.
@since 1.0.0
**/
Expand Down

0 comments on commit 48a7660

Please sign in to comment.