Skip to content

Instantly share code, notes, and snippets.

View jskway's full-sized avatar
🎧

Jack Kim jskway

🎧
View GitHub Profile
@jskway
jskway / pdffullscreen.js
Created August 26, 2025 23:42
Fullscreen PSPDFKit snippet
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;
}
@jskway
jskway / redux-setup
Created September 27, 2019 23:48
Redux Setup
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.