mkremins / flense

Edit trees, not text
MIT License
101 stars 3 forks source link

Allow actions to contain multiple predicate-edit pairs #14

Closed mkremins closed 10 years ago

mkremins commented 10 years ago

Rather than requiring each action to declare a single :edit function and (optionally) a single :when predicate to determine whether the action can be performed on a given app-state, it should be possible to call the action function multiple times with the same name but different :edit/:when pairs.

Each pair will be stored under the same action name; when the action is triggered, each predicate will be invoked on the application state in order of registration, and the first predicate to return truthy will cause its corresponding :edit function to be invoked.

This should allow for greater separation of concerns between unrelated branches of the same action.