Commit b58a9de0 authored by Wolfram Kriesing's avatar Wolfram Kriesing

Make it more explicit what the default values mean.

parent 7808e21b
const { fetch } = require('./backend');
const cache = {};
const defaultDependencies = () => {
return { fetch, cache };
};
const loadStudent = ({ studentId }, dependencies = { fetch, cache }) => {
const loadStudent = ({ studentId }, dependencies = defaultDependencies()) => {
const cache = dependencies.cache;
const fetch = dependencies.fetch;
if (!cache[studentId]) {
......
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