How to react to resource? | NulledTeam UnderGround | The Best Scripts Site In The World

How to react to resource?

bobrosssuckspp

Newbie
Registered
Joined
May 12, 2019
Messages
1
Reaction score
1
Points
3
Age
21
Location
my dick
Site Script
XenForo
Hi,

i'm going to sound very retarded, but how do I react to download a resource?

Thank you
 
  • Haha
Reactions: Fr0stiePxP

Fr0stiePxP

Newbie
Registered
Joined
Mar 29, 2020
Messages
1
Reaction score
0
Points
1
Age
20
Location
Alabama
Site Script
XenForo
hover over the like and press an emoji like i just did ?
 

Lewis-H

Newbie
Registered
Joined
Jun 16, 2020
Messages
10
Reaction score
0
Points
1
Age
25
Location
london
Site Script
WordPress
import ReactResource from 'react-resource';

// Model class definition
const User = new ReactResource('/api/users/{:id}.json', { id: ':id' })

// Custom instance method
User.prototype.getName = function() {
return [this.first_name, this.last_name].join(" ");
};

// Action `create` as class method
User.create({first_name: 'John', last_name: 'Doe'}, (user) => {
console.log('[CLASS]', user.getName());
});

// Actions `create` as instance method
const user = new User({first_name: 'Johnny', last_name: 'Bravo'});
const promise = user.$create((user) => {
console.log('[INSTANCE]', user.getName());
});