account for case where callback isn't provided
This commit is contained in:
parent
c53593d4ee
commit
7d70ea9ecd
2 changed files with 4 additions and 3 deletions
|
@ -19,10 +19,11 @@ import Visualize from './Visualize'
|
||||||
* - Metamaps.Topics
|
* - Metamaps.Topics
|
||||||
*/
|
*/
|
||||||
|
|
||||||
|
const noOp = () => {}
|
||||||
const Synapse = {
|
const Synapse = {
|
||||||
// this function is to retrieve a synapse JSON object from the database
|
// this function is to retrieve a synapse JSON object from the database
|
||||||
// @param id = the id of the synapse to retrieve
|
// @param id = the id of the synapse to retrieve
|
||||||
get: function (id, callback) {
|
get: function (id, callback = noOp) {
|
||||||
// if the desired topic is not yet in the local topic repository, fetch it
|
// if the desired topic is not yet in the local topic repository, fetch it
|
||||||
if (Metamaps.Synapses.get(id) == undefined) {
|
if (Metamaps.Synapses.get(id) == undefined) {
|
||||||
$.ajax({
|
$.ajax({
|
||||||
|
|
|
@ -28,11 +28,11 @@ import Visualize from './Visualize'
|
||||||
* - Metamaps.Synapses
|
* - Metamaps.Synapses
|
||||||
* - Metamaps.Topics
|
* - Metamaps.Topics
|
||||||
*/
|
*/
|
||||||
|
const noOp = () => {}
|
||||||
const Topic = {
|
const Topic = {
|
||||||
// this function is to retrieve a topic JSON object from the database
|
// this function is to retrieve a topic JSON object from the database
|
||||||
// @param id = the id of the topic to retrieve
|
// @param id = the id of the topic to retrieve
|
||||||
get: function (id, callback) {
|
get: function (id, callback = noOp) {
|
||||||
// if the desired topic is not yet in the local topic repository, fetch it
|
// if the desired topic is not yet in the local topic repository, fetch it
|
||||||
if (Metamaps.Topics.get(id) == undefined) {
|
if (Metamaps.Topics.get(id) == undefined) {
|
||||||
$.ajax({
|
$.ajax({
|
||||||
|
|
Loading…
Add table
Reference in a new issue