
The difference between Events and Effects is that Events are external things that happen and are We sometimes distinguish betweenĮffect description (immutable messages) and Effect execution (making the desired Effect actually String 'foo'", and not than an invocation of api.search("foo"). You can think of it as a statement that "I want to send a search request with the query 'Effect' in Mobius is a description of a desired impure function invocation, not the invocation The term ‘Effect’ wasĬhosen because it is similar to ‘side effect’. Sometimes, you need to change or fetch information that currently isn’t in the Model (for example,ĭata that resides in a backend service). The latter is more appropriate in the UI. Note: The expression “from a business logic perspective” means that canLogin is a good name for a field in the model, but loginButtonEnabled is not. Instead theyĬan be calculated when the UI is updated. So concatenated strings, formatted dates, etc., don’t need to be included in the model.

What’s presented in the UI should be derivable from the model, but it doesn’t have to be identical. Pure and therefore cannot read state externally.
Mobius phantasmic loop guide update#
The Model and the Event must contain all the data that the Updateįunction needs in order to make decisions when an Event happens, since the Update function must be The model is an immutable representation of the loop’s state from a business logic perspective. The actual query string attached, whereas a ClearHistory event probably doesn’t need any payload.Ī SearchResultReceived event includes the response from the search backend, and so on. So a QueryUpdated event almost certainly has

There is usually one loop per feature such as “the album page”, “login flow”, etc., but a loop canĪlso be UI-less and for instance be tied to the lifecycle of an application or a user session.Ī Mobius loop receives Events, which are passed to an Mobius Loop ¶Ī Mobius loop is a part of an application, usually including a user interface.

Yourself with this overview before going in depth. The terms haveĭetailed explanations in the Reference Guide section of the wiki, but it's best to familiarise This document is intended as a quick overview of the core concepts in Mobius.
