Open vJIYEv opened 4 months ago
All modified and coverable lines are covered by tests :white_check_mark:
Project coverage is 82.51%. Comparing base (
67b7156
) to head (75ab31c
).
:umbrella: View full report in Codecov by Sentry.
:loudspeaker: Have feedback on the report? Share it here.
Checklist
Issue Resolved / Feature Added
webos/LS2Request provides a class for making LS2 service request. It would be better to support the developer to request LS2 request with a promise
Resolution
LS2Request.send
is a method to request luna call to a webos app or service. Sosend
method with promise is what developers need. To provideLS2Request.send
as a promise, I add a new function:sendLS2Request
sendLS2Request
returns a promise which runLS2Request.send
. This promise will be resolved whensend
successes, and will be rejected whensend
fails. So developers can use their ownonSuccess
andonFailure
after the promise is resolved or rejected.Additional Considerations
I tried to make a new function as a react custom hook where
useEffect
is combined withsendLS2Request
so that developers can use it more easily. However, I couldn't becauseonSuccess
andonFailure
functions both should be given in a component and should be inuseEffect
hook. I think it's better for developers to choose useuseEffect
or not in a component case by case.Links
WRQ-153
Comments
Enact-DCO-1.0-Signed-off-by: Jiye Kim (jiye.kim@lge.com)