Commit eb88abf8 authored by Laurent Wouters's avatar Laurent Wouters
Browse files

Adding new application framework

parent 067b93bd5410
......@@ -52,7 +52,7 @@ let renderRoot =
</div>;
};
let renderCollection =
let renderCollectionComplete =
(
self: ReasonReact.self(Framework.appState, _, Framework.appAction),
state: Framework.appState,
......@@ -104,7 +104,19 @@ let renderCollection =
</div>;
};
let renderEntity =
let renderCollection =
(
self: ReasonReact.self(Framework.appState, _, Framework.appAction),
state: Framework.appState,
) => {
let resource = Framework.States.root_resource(state);
switch (resource.data) {
| None => renderLoading(self, state)
| Some(_) => renderCollectionComplete(self, state)
};
};
let renderEntityComplete =
(
_self: ReasonReact.self(Framework.appState, _, Framework.appAction),
state: Framework.appState,
......@@ -136,6 +148,18 @@ let renderEntity =
</div>;
};
let renderEntity =
(
self: ReasonReact.self(Framework.appState, _, Framework.appAction),
state: Framework.appState,
) => {
let resource = Framework.States.root_resource(state);
switch (resource.data) {
| None => renderLoading(self, state)
| Some(_) => renderEntityComplete(self, state)
};
};
let defaultRegistry =
Framework.Create.registry([
Framework.Create.view(
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment