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
For creating routers for server/client shared use, this would be more useful than current Router.Create:
letCreateRouter(ser:'T ->list<string>)(des:list<string>->option<'T>)={
Parse =fun path ->match des path.Segments with| Some ep ->
Seq.singleton ({ path with Segments =[]}, ep)| None ->
Seq.empty
Write =fun value ->
Some (Seq.singleton (Route.Segment(ser value)))}: Router<'T>
Current one is deserializing to 'T, not option<'T>, which is ok for fully client-side routing use when one of the EndPoint cases are representing a wrong URI, but not good for server-side use when even resource links would be hijacked by Sitelets routing if set up that way. Changing signature is a breaking change, but probably less confusing than having two different functions for the same basic goal, but one only working in a specific side case.
The text was updated successfully, but these errors were encountered:
For creating routers for server/client shared use, this would be more useful than current
Router.Create
:Current one is deserializing to
'T
, notoption<'T>
, which is ok for fully client-side routing use when one of the EndPoint cases are representing a wrong URI, but not good for server-side use when even resource links would be hijacked by Sitelets routing if set up that way. Changing signature is a breaking change, but probably less confusing than having two different functions for the same basic goal, but one only working in a specific side case.The text was updated successfully, but these errors were encountered: