Initial value for local resources

Description

Add a key initial to set an initial value for a local resource.

Environment

None

Potential Workaround

None

Checklist

hide

TestRail: Results

Activity

Show:

Mike TaylorJuly 5, 2017 at 3:10 PM

Yep: I found the changes in [commit 639a82875b8fae8ac8d6ef65aab27d30cf76de86](https://github.com/folio-org/stripes-connect/commit/639a82875b8fae8ac8d6ef65aab27d30cf76de86)

Mike TaylorJuly 5, 2017 at 3:04 PM

By inspection of the Users.js code, it appears the syntax for this is:

Jason SkomorowskiApril 12, 2017 at 1:37 AM

Was wanting to set the initial record count for paging in so I put in an interim solution for this. Ultimately though we need to resolve the module vs. class vs. instance decisions in connect and have a sort of lifecycle for resources. In that spirit I have it setting the initial value (if none is set) in a method called init.

Another area to look into is the initial state a reducer uses if the state passed to it is undefined. Maybe addReducer should in fact call the reducer with undefined?

Mike TaylorMarch 3, 2017 at 4:32 PM

Added Niels-Erik as a watcher, since this is relevant to his .

Mike TaylorMarch 3, 2017 at 4:31 PM
Edited

Even after the component is created and connected it seems to have no props: I inserted a couple of temporary log-messages in our connect function:

And they log:

Wrapper.props = undefined – connect.js:156

Connected.props = undefined – connect.js:158

Done

Details

Assignee

Reporter

Priority

TestRail: Cases

Open TestRail: Cases

TestRail: Runs

Open TestRail: Runs

Created January 27, 2017 at 9:42 PM
Updated July 5, 2017 at 3:28 PM
Resolved April 12, 2017 at 1:37 AM
TestRail: Cases
TestRail: Runs