This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
loadPSPDFKit: function(divId, docId, jwt) { | |
PSPDFKit.unload(divId); | |
const userMetadata = $('#user_meta_data').metadata(); | |
var permId = ''; | |
if ($('#doc_meta_data').length > 0) { | |
permId = $('#doc_meta_data').metadata().perm_id; | |
} |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Decide on your application state. | |
Create a separate reducer to handle each piece of state. | |
Each piece of state would be a key on an object (ie. todos and task) | |
Initially just set up the default switch case that returns the state. | |
Decide which actions each reducer needs to handle (if any). | |
Create an action constant for each action and export it. This helps with intellisense. | |
Write an action creator for each action - a function that returns an object with type (and payload if necessary) properties. The payload can be named whatever you want. | |
Import the constants you created into their associated reducers and handle state logic for each action. | |
Now create an index file that imports all your reducers and exports a combined rootReducer (using the combineReducers function from redux). | |
Create your store using the createStore function from redux, which takes in the rootReducer you exported, and any middleware you want to attach. |